test testimonials carousel renders
This commit is contained in:
parent
f50ea8707c
commit
8fe6dbc5c2
1 changed files with 35 additions and 0 deletions
|
|
@ -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')
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue