forked from patternfly/patternfly-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
menutoggle.spec.ts
28 lines (24 loc) · 995 Bytes
/
menutoggle.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
describe('MenuToggle Test', () => {
it('Navigate to demo section', () => {
cy.visit('http://localhost:3000/');
cy.get('#menu-toggle-demo-nav-item-link').click();
cy.url().should('eq', 'http://localhost:3000/menu-toggle-demo-nav-link');
});
it('Verify basic', () => {
cy.get('#collapsed').should('have.class', 'pf-c-menu-toggle');
});
it('Verify styling props', () => {
cy.get('#expanded').should('have.class', 'pf-m-expanded');
cy.get('#disabled').should('have.attr', 'disabled');
cy.get('#primary').should('have.class', 'pf-m-primary');
cy.get('#plain').should('have.class', 'pf-m-plain');
});
it('Verify icon toggle', () => {
cy.get('#collapsed .pf-c-menu-toggle__icon').should('not.exist');
cy.get('#icon .pf-c-menu-toggle__icon').should('exist');
});
it('Verify badge toggle', () => {
cy.get('#collapsed .pf-c-menu-toggle__count').should('not.exist');
cy.get('#badge .pf-c-menu-toggle__count').should('exist');
});
});