forked from patternfly/patternfly-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchipgroupwithcategory.spec.ts
29 lines (27 loc) · 1 KB
/
chipgroupwithcategory.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
describe('Chip Group with Category Demo Test', () => {
it('Navigate to demo section', () => {
cy.visit('http://localhost:3000/');
cy.get('#chipgroup-with-category-demo-nav-item-link').click();
cy.url().should('eq', 'http://localhost:3000/chipgroup-with-category-demo-nav-link');
});
it('Verify delete button on first chip group', () => {
const chipGroup = cy.get('.pf-c-chip-group').first();
const chipGroupButton = chipGroup.get('#remove_group_pf-random-id-0');
chipGroupButton.should('be.visible');
chipGroupButton.click();
chipGroup.should('not.exist');
});
it('Displays Tooltip', () => {
cy.get('.pf-c-chip-group__label')
.last()
.then((tooltipLink: JQuery<HTMLHeadingElement>) => {
cy.get('.pf-c-tooltip').should('not.exist');
cy.wrap(tooltipLink)
.trigger('mouseenter')
.get('.pf-c-tooltip')
.should('exist')
.get('.pf-c-tooltip')
.contains('Category 3 has a very long name');
});
});
});