-
Notifications
You must be signed in to change notification settings - Fork 353
/
Copy pathtreeview.spec.ts
43 lines (40 loc) · 1.79 KB
/
treeview.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
describe('TreeView Demo Test', () => {
it('Navigate to demo section', () => {
cy.visit('http://localhost:3000/treeview-demo-nav-link');
});
it('Verify expand/collapse all', () => {
cy.get('#App1').should('exist');
cy.get('#expand').click();
cy.get('#expand').click();
cy.get('#App1').should('not.exist');
cy.get('#expand').click();
cy.get('#App1').should('exist');
});
it('Verify treeview', () => {
cy.get('#basic').should('exist');
cy.get('#App1').should('exist');
cy.get('#App1').click();
cy.get('#App1Settings').should('exist');
cy.get('#App1Settings').click();
cy.get('#App1Settings .pf-v6-c-tree-view__node').should('have.class', 'pf-m-current');
cy.get('#input-search').type('Sources');
cy.get('#App1').should('not.exist');
cy.get('#Sources').should('exist');
cy.get('#mixed').should('exist');
cy.get(
'#FCost > :nth-child(1) > .pf-v6-c-tree-view__node > .pf-v6-c-tree-view__node-container > .pf-v6-c-tree-view__node-count > .pf-v6-c-badge'
).contains('custom badge');
});
it.skip('Verify treeview keyboard interactions', () => {
cy.get('#input-search').type('{Backspace}{Backspace}{Backspace}{Backspace}{Backspace}{Backspace}{Backspace}');
cy.get('#basic').should('exist');
cy.get('#App1').should('exist');
cy.get('#App1 > .pf-v6-c-tree-view__content > .pf-v6-c-tree-view__node').type('{rightArrow}');
cy.get('#App1Settings').should('exist');
cy.get('#App1Current').should('exist');
cy.get('#App1 > .pf-v6-c-tree-view__content > .pf-v6-c-tree-view__node').type('{downArrow}{leftArrow}{leftArrow}');
cy.get('#App1Settings').should('not.exist');
cy.get('#App1Current').should('not.exist');
cy.get('#App1 > .pf-v6-c-tree-view__content > .pf-v6-c-tree-view__node').type('{upArrow}');
});
});