/
stories-list.js
27 lines (25 loc) · 1.23 KB
/
stories-list.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/// <reference types="cypress" />
describe('Stories list', () => {
it('should display the stories', () => {
cy.clearLocalStorage()
cy.visit('/')
cy.get('[data-test-id="story-list-item"]').should('have.length', 27)
cy.get('[data-test-id="story-list-item"]').contains('🐱 Meow')
cy.get('[data-test-id="story-list-item"]').contains('BaseButton')
.contains('3') // Variants count
cy.get('[data-test-id="story-list-item"]').contains('Demo')
cy.get('[data-test-id="story-list-folder"]').should('have.length', 2)
})
it('should toggle folder', () => {
cy.clearLocalStorage()
cy.visit('/')
cy.get('[data-test-id="story-list-folder"]').contains('Sub Folder').click()
cy.get('[data-test-id="story-list-item"]').contains('Sub Story 2')
cy.get('[data-test-id="story-list-folder"]').contains('Meow').click()
cy.get('[data-test-id="story-list-item"]').contains('Sub Story 1')
cy.get('[data-test-id="story-list-folder"]').contains('Meow').click()
cy.get('[data-test-id="story-list-item"]').should('not.contain', 'Sub Story 1')
cy.get('[data-test-id="story-list-folder"]').contains('Sub Folder').click()
cy.get('[data-test-id="story-list-item"]').should('not.contain', 'Sub Story 2')
})
})