diff --git a/frontend/rabbi_gerzi/cypress/e2e/contact.cy.ts b/frontend/rabbi_gerzi/cypress/e2e/contact.cy.ts index 88b1570..ad066b2 100644 --- a/frontend/rabbi_gerzi/cypress/e2e/contact.cy.ts +++ b/frontend/rabbi_gerzi/cypress/e2e/contact.cy.ts @@ -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')