test subscribe centering
This commit is contained in:
parent
d3f6ab9cd7
commit
6e98825767
1 changed files with 18 additions and 0 deletions
|
|
@ -80,6 +80,24 @@ describe('contact page', () => {
|
|||
cy.get('[data-cy="contact-social"]').should('be.visible')
|
||||
})
|
||||
|
||||
it('centers the subscribe card vertically in its section', () => {
|
||||
cy.get('[data-cy="get-involved"]').then((sectionElements) => {
|
||||
const sectionElement = sectionElements[0]
|
||||
const cardElement = sectionElement.querySelector('.get-involved__card')
|
||||
|
||||
if (cardElement === null) {
|
||||
throw new Error('Get involved card is missing')
|
||||
}
|
||||
|
||||
const sectionBounds = sectionElement.getBoundingClientRect()
|
||||
const cardBounds = cardElement.getBoundingClientRect()
|
||||
const topBuffer = cardBounds.top - sectionBounds.top
|
||||
const bottomBuffer = sectionBounds.bottom - cardBounds.bottom
|
||||
|
||||
expect(topBuffer).to.be.closeTo(bottomBuffer, 1)
|
||||
})
|
||||
})
|
||||
|
||||
it('renders the get involved form and footer', () => {
|
||||
cy.get('[data-cy="get-involved"]').within(() => {
|
||||
cy.contains('h2', 'Get Involved').should('be.visible')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue