test testimonials carousel renders

This commit is contained in:
Yisroel Baum 2026-05-16 21:56:49 +03:00
parent f50ea8707c
commit 8fe6dbc5c2
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9

View file

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