forked from patternfly/patternfly-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tabsdisable.spec.ts
45 lines (42 loc) · 1.57 KB
/
tabsdisable.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
describe('Disabled Tab Demo Test', () => {
it('Navigate to demo section', () => {
cy.visit('http://localhost:3000/tabs-disabled-demo-nav-link');
});
const tabIds = {
notDisabled: {
button: '#pf-tab-0-not-disabled',
content: '#pf-tab-section-0-not-disabled'
},
disabled: {
button: '#pf-tab-1-is-disabled',
content: '#pf-tab-section-1-is-disabled'
},
ariaDisabled: {
button: '#pf-tab-2-is-aria-disabled',
content: '#pf-tab-section-2-is-aria-disabled'
},
withTooltip: {
button: '#pf-tab-3-with-tooltip',
content: '#pf-tab-section-3-with-tooltip'
}
};
const { notDisabled, disabled, ariaDisabled, withTooltip } = tabIds;
it('Verify disabled tabs', () => {
cy.get('#disabledTabs').within(() => {
cy.get(notDisabled.content).should('not.have.a.property', 'hidden');
cy.get(disabled.button).click({ force: true });
cy.get(disabled.content).should('not.exist');
cy.get(notDisabled.content).should('not.have.a.property', 'hidden');
cy.get(ariaDisabled.button).click({ force: true });
cy.get(ariaDisabled.content).should('not.exist');
cy.get(notDisabled.content).should('not.have.a.property', 'hidden');
cy.get(withTooltip.button).click({ force: true });
cy.get(withTooltip.content).should('not.exist');
cy.get(notDisabled.content).should('not.have.a.property', 'hidden');
});
});
it('Verify aria-disabled with tooltip', () => {
cy.get(withTooltip.button).trigger('mouseover');
cy.get('.pf-v5-c-tooltip').should('be.visible');
});
});