|
| 1 | +/// <reference types="cypress" /> |
| 2 | + |
| 3 | +describe('CoreUI v2 template',()=>{ |
| 4 | + |
| 5 | +beforeEach(()=>{ |
| 6 | +cy.visit('/'); |
| 7 | +}); |
| 8 | + |
| 9 | +it('should display CoreUI Dashboard',()=>{ |
| 10 | +cy.viewport(600,800); |
| 11 | +constparagraph=cy.get('ng-component'); |
| 12 | +paragraph.should('contain.text','CoreUI Dashboard'); |
| 13 | +}); |
| 14 | + |
| 15 | +it('should toggle `sidebar-minimized` body.class on `sidebar-minimizer` click',()=>{ |
| 16 | +cy.viewport('macbook-16'); |
| 17 | +cy.get('.app').invoke('attr','class').should('not.contain','sidebar-minimized'); |
| 18 | +cy.get('.sidebar-minimizer').click(); |
| 19 | +cy.get('.app').invoke('attr','class').should('contain','sidebar-minimized'); |
| 20 | +cy.get('.sidebar-minimizer').click(); |
| 21 | +cy.get('.app').invoke('attr','class').should('not.contain','sidebar-minimized'); |
| 22 | +}); |
| 23 | + |
| 24 | +it('should toggle `sidebar-show` body.class on `navbar-toggler` click',()=>{ |
| 25 | +cy.viewport(600,800); |
| 26 | +cy.get('.app').invoke('attr','class').should('not.contain','sidebar-show'); |
| 27 | +cy.get('.navbar-toggler.d-lg-none').first().click(); |
| 28 | +cy.get('.app').invoke('attr','class').should('contain','sidebar-show'); |
| 29 | +cy.get('.navbar-toggler').first().click(); |
| 30 | +cy.get('.app').invoke('attr','class').should('not.contain','sidebar-show'); |
| 31 | +}); |
| 32 | + |
| 33 | +it('should toggle `aside-menu-lg-show` body.class on `navbar-toggler` click',()=>{ |
| 34 | +cy.viewport('macbook-16'); |
| 35 | +cy.get('.app').invoke('attr','class').should('not.contain','aside-menu-lg-show'); |
| 36 | +cy.get('.navbar-toggler.d-none.d-lg-block').last().click(); |
| 37 | +cy.get('.app').invoke('attr','class').should('contain','aside-menu-lg-show'); |
| 38 | +cy.get('.navbar-toggler.d-none.d-lg-block').last().click(); |
| 39 | +cy.get('.app').invoke('attr','class').should('not.contain','aside-menu-lg-show'); |
| 40 | +}); |
| 41 | +}); |