forked from patternfly/patternfly-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlabelgroupvertical.spec.ts
30 lines (25 loc) · 1.02 KB
/
labelgroupvertical.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
describe('Label Group Default Is Open Demo Test', () => {
it('Navigate to demo section', () => {
cy.visit('http://localhost:3000/labelgroup-vertical-demo-nav-link');
});
it('Verify label default text', () => {
cy.get('.pf-v6-c-label__content').first().contains('Lemons');
});
it('Verify labelgroup is vertical', () => {
const labelgroup = cy.get('.pf-v6-c-label-group.pf-m-vertical');
labelgroup.should('exist');
});
it('Verify one label shown', () => {
cy.get('.pf-v6-c-label-group').find('.pf-v6-c-label').not('.pf-m-overflow').should('have.length', 1);
});
it('Verify custom overflow text', () => {
const overflowButton = cy.get('.pf-m-overflow');
const overflowLabel = overflowButton.get('.pf-v6-c-label__content');
overflowLabel.contains('Expand labels');
overflowButton.click();
overflowLabel.contains('Collapse labels');
});
it('Verify aria-label works', () => {
cy.get('.pf-v6-c-label-group__list').should('have.attr', 'aria-label', 'Vertical fruit labels');
});
});