diff --git a/frontend/rabbi_gerzi/cypress/e2e/home.cy.ts b/frontend/rabbi_gerzi/cypress/e2e/home.cy.ts index 59d4ea3..502cb5c 100644 --- a/frontend/rabbi_gerzi/cypress/e2e/home.cy.ts +++ b/frontend/rabbi_gerzi/cypress/e2e/home.cy.ts @@ -86,3 +86,38 @@ describe('homepage unique voice section', () => { }) }) }) + +describe('homepage testimonials carousel', () => { + beforeEach(() => { + cy.visit('/') + }) + + it('renders the heading and the active testimonial', () => { + cy.get('[data-cy="testimonials"]').within(() => { + cy.contains('h2', 'What People Are Saying').should('be.visible') + cy.get('[data-cy="testimonial-active"]').within(() => { + cy.contains('Nathaniel M').should('be.visible') + cy.contains('best Jewish day schools').should('be.visible') + }) + }) + }) + + it('advances to the next testimonial when next is clicked', () => { + cy.get('[data-cy="testimonials"]').within(() => { + cy.get('[data-cy="testimonial-active"]') + .should('contain.text', 'Nathaniel M') + cy.get('[data-cy="testimonial-next"]').click() + cy.get('[data-cy="testimonial-active"]') + .should('not.contain.text', 'Nathaniel M') + }) + }) + + it('goes back to the previous testimonial when prev is clicked', () => { + cy.get('[data-cy="testimonials"]').within(() => { + cy.get('[data-cy="testimonial-next"]').click() + cy.get('[data-cy="testimonial-prev"]').click() + cy.get('[data-cy="testimonial-active"]') + .should('contain.text', 'Nathaniel M') + }) + }) +})