test subscribe centering

This commit is contained in:
Yisroel Baum 2026-06-13 23:17:52 +03:00
parent d3f6ab9cd7
commit 6e98825767
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9

View file

@ -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')