forked from patternfly/patternfly-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlabelgroupdefaultisopen.spec.ts
44 lines (38 loc) · 1.23 KB
/
labelgroupdefaultisopen.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
describe('Label Group Default Is Open Demo Test', () => {
it('Navigate to demo section', () => {
cy.visit('http://localhost:3000/');
cy.get('#labelgroup-default-is-open-demo-nav-item-link').click();
cy.url().should('eq', 'http://localhost:3000/labelgroup-default-is-open-demo-nav-link');
});
it('Verify label default text', () => {
cy.get('.pf-c-label__content')
.first()
.contains('Lemons');
});
it('Verify label is open on default', () => {
cy.get('.pf-c-label__content')
.eq(3)
.contains('grapefruit');
});
it('Verify label has badge', () => {
cy.get('span')
.children('.pf-c-badge')
.should('not.be.undefined');
cy.get('span')
.children('.pf-c-badge')
.should('not.equal', null);
});
it('Verify show less button works', () => {
cy.get('.pf-m-overflow').click();
cy.get('.pf-c-label__content').contains('more');
});
it('Verify more button works', () => {
cy.get('.pf-m-overflow').click();
cy.get('.pf-c-label__content').contains('Show Less');
});
it('Verify delete button on first label', () => {
const label = cy.get('.pf-c-label').eq(0);
label.children('.pf-c-button').click();
label.should('not.exist');
});
});