forked from patternfly/patternfly-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsimplelist.spec.ts
24 lines (19 loc) · 1.24 KB
/
simplelist.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
describe('Select Test', () => {
it('Navigate to demo section', () => {
cy.visit('http://localhost:3000/simple-list-demo-nav-link');
});
it('Select second item', () => {
cy.get('#simple-list-demo > ul > :nth-child(1) > button').should('have.class', 'pf-m-current');
cy.get('#simple-list-demo > ul > :nth-child(2) > button').should('not.have.class', 'pf-m-current');
cy.get('#simple-list-demo > ul > :nth-child(2) > button').click();
cy.get('#simple-list-demo > ul > :nth-child(1) > button').should('not.have.class', 'pf-m-current');
cy.get('#simple-list-demo > ul > :nth-child(2) > button').should('have.class', 'pf-m-current');
});
it('Select second item (uncontrolled)', () => {
cy.get('#simple-list-demo-uncontrolled > ul > :nth-child(1) > button').should('have.class', 'pf-m-current');
cy.get('#simple-list-demo-uncontrolled > ul > :nth-child(2) > button').should('not.have.class', 'pf-m-current');
cy.get('#simple-list-demo-uncontrolled > ul > :nth-child(2) > button').click();
cy.get('#simple-list-demo-uncontrolled > ul > :nth-child(1) > button').should('not.have.class', 'pf-m-current');
cy.get('#simple-list-demo-uncontrolled > ul > :nth-child(2) > button').should('have.class', 'pf-m-current');
});
});