forked from patternfly/patternfly-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtabexpandabledemo.spec.ts
65 lines (62 loc) · 3.09 KB
/
tabexpandabledemo.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
64
65
describe('Tab Demo Test', () => {
it('Navigate to demo section', () => {
cy.visit('http://localhost:3000/');
cy.get('#tab-expandable-demo-nav-item-link').click();
cy.url().should('eq', 'http://localhost:3000/tab-expandable-demo-nav-link');
});
it('Verify controlled expandable vertical tabs ', () => {
cy.get('#expandable-controlled').should('exist');
cy.get('#expandable-controlled.pf-m-expanded').should('not.exist');
// tabs list should not exist
cy.get('#expandable-controlled').within(() => {
cy.get('.pf-v6-c-tabs__list').should('not.be.visible');
});
cy.get('#expandable-controlled').find('.pf-v6-c-tabs__toggle-icon').click();
cy.get('#expandable-controlled.pf-m-expanded').should('exist');
// tabs list should exist
cy.get('#expandable-controlled').within(() => {
cy.get('.pf-v6-c-tabs__list').should('be.visible');
});
cy.get('#expandable-controlled').find('.pf-v6-c-tabs__toggle-icon').click();
cy.get('#expandable-controlled.pf-m-expanded').should('not.exist');
// tabs list should not exist
cy.get('#expandable-controlled').within(() => {
cy.get('.pf-v6-c-tabs__list').should('not.be.visible');
});
});
it('Verify uncontrolled expandable vertical tabs ', () => {
cy.get('#expandable-uncontrolled').should('exist');
cy.get('#expandable-uncontrolled.pf-m-expanded').should('not.exist');
// tabs list should not exist
cy.get('#expandable-uncontrolled').within(() => {
cy.get('.pf-v6-c-tabs__list').should('not.be.visible');
});
cy.get('#expandable-uncontrolled').find('.pf-v6-c-tabs__toggle-icon').click();
cy.get('#expandable-uncontrolled.pf-m-expanded').should('exist');
// tabs list should exist
cy.get('#expandable-uncontrolled').within(() => {
cy.get('.pf-v6-c-tabs__list').should('be.visible');
});
cy.get('#expandable-uncontrolled').find('.pf-v6-c-tabs__toggle-icon').click();
cy.get('#expandable-uncontrolled.pf-m-expanded').should('not.exist');
// tabs list should not exist
cy.get('#expandable-uncontrolled').within(() => {
cy.get('.pf-v6-c-tabs__list').should('not.be.visible');
});
});
it('Verify expandable breakpoints are applied ', () => {
// expandable
cy.get('#expandable-breakpoints1.pf-m-expandable-on-sm').should('exist');
cy.get('#expandable-breakpoints1.pf-m-expandable-on-md').should('exist');
cy.get('#expandable-breakpoints1.pf-m-expandable-on-lg').should('exist');
cy.get('#expandable-breakpoints1.pf-m-expandable-on-xl').should('exist');
cy.get('#expandable-breakpoints1.pf-m-expandable-on-2xl').should('exist');
// non expandable
cy.get('#expandable-breakpoints2.pf-m-expandable').should('exist');
cy.get('#expandable-breakpoints2.pf-m-non-expandable-on-sm').should('exist');
cy.get('#expandable-breakpoints2.pf-m-non-expandable-on-md').should('exist');
cy.get('#expandable-breakpoints3.pf-m-expandable-on-xl').should('exist');
cy.get('#expandable-breakpoints1.pf-m-expandable-on-2xl').should('exist');
cy.get('#expandable-breakpoints3.pf-m-non-expandable').should('exist');
});
});