forked from patternfly/patternfly-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
applicationlauncher.spec.ts
45 lines (40 loc) · 1.48 KB
/
applicationlauncher.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('Application Launcher Favorites Demo Test', () => {
it('Navigate to demo section', () => {
cy.visit('http://localhost:3000/application-launcher-favorites-demo-nav-link');
});
it('Verify application launcher button', () => {
cy.get('button').should('have.class', 'pf-c-button pf-m-plain');
});
it('Verify app launcher menu toggle', () => {
cy.get('#toggle-fav').click();
cy.get('.pf-c-app-launcher__menu ul').should('exist');
cy.get('#toggle-fav').click();
cy.get('.pf-c-app-launcher__menu').should('not.exist');
});
it('Verify application favorite works', () => {
cy.get('#toggle-fav').click();
cy.get('#item-1 > .pf-m-action').click();
cy.get('.pf-c-app-launcher__menu .pf-c-app-launcher__group :nth-child(1).pf-c-app-launcher__group-title')
.first()
.contains('Favorites');
});
it('Verify application un-favorite works', () => {
cy.get('#item-1 > .pf-m-action')
.first()
.click();
cy.get('.pf-c-app-launcher__menu .pf-c-app-launcher__group :nth-child(1).pf-c-app-launcher__group-title')
.first()
.contains('Favorites')
.should('not.exist');
});
it('Verify application search/filter works', () => {
cy.get('.pf-c-app-launcher__menu')
.find('li')
.should('have.length', 7);
cy.get('.pf-c-app-launcher__menu-search input').type('button');
cy.get('.pf-c-app-launcher__menu')
.find('li')
.should('have.length', 3);
cy.get('#toggle-fav').click();
});
});