forked from patternfly/patternfly-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
togglegroup.spec.ts
63 lines (55 loc) · 1.59 KB
/
togglegroup.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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
describe('Toggle Group Demo Test', () => {
it('Navigate to demo section', () => {
cy.visit('http://localhost:3000/toggle-group-demo-nav-link');
});
it('Verify toggle group buttons can be checked unless disabled', () => {
cy.get('#first')
.click()
.should('have.class', 'pf-m-selected');
cy.get('#first')
.click()
.should('not.have.class', 'pf-m-selected');
cy.get('#second')
.click()
.should('have.class', 'pf-m-selected');
cy.get('#second')
.click()
.should('not.have.class', 'pf-m-selected');
cy.get('#disabled').should('be.disabled');
cy.get('#third')
.click()
.should('have.class', 'pf-m-selected');
cy.get('#third')
.click()
.should('not.have.class', 'pf-m-selected');
cy.get('#fourth')
.click()
.should('have.class', 'pf-m-selected');
cy.get('#fourth')
.click()
.should('not.have.class', 'pf-m-selected');
cy.get('#fifth')
.click()
.should('have.class', 'pf-m-selected');
cy.get('#sixth')
.click()
.should('have.class', 'pf-m-selected');
cy.get('#seventh')
.click()
.should('have.class', 'pf-m-selected');
cy.get('#fifth')
.click()
.should('not.have.class', 'pf-m-selected');
cy.get('#sixth')
.click()
.should('not.have.class', 'pf-m-selected');
cy.get('#seventh')
.click()
.should('not.have.class', 'pf-m-selected');
});
it('Verify toggle group is compact', () => {
cy.get('.pf-c-toggle-group')
.eq(2)
.should('have.class', 'pf-m-compact');
});
});