|
| 1 | +/// <reference types="cypress"/> |
| 2 | +import { Classes } from '@blueprintjs/core'; |
| 3 | + |
| 4 | +describe('app shortcuts', () => { |
| 5 | + before(() => { |
| 6 | + cy.visit('http://127.0.0.1:8080'); |
| 7 | + }); |
| 8 | + |
| 9 | + beforeEach(() => { |
| 10 | + // load files |
| 11 | + cy.CDAndList(0, "/"); |
| 12 | + cy.get("#view_0 [data-cy-path]") |
| 13 | + .invoke("val", "/") |
| 14 | + .focus() |
| 15 | + .blur(); |
| 16 | + }); |
| 17 | + |
| 18 | + it('explorer tab should be active', () => { |
| 19 | + cy.get('.data-cy-explorer-tab') |
| 20 | + .should('have.class', Classes.INTENT_PRIMARY) |
| 21 | + |
| 22 | + cy.get(".downloads").should("not.exist"); |
| 23 | + cy.get(".sideview.active").should("be.visible"); |
| 24 | + }); |
| 25 | + |
| 26 | + it('click on nav tabs should activate each tab', () => { |
| 27 | + cy.get('.data-cy-downloads-tab') |
| 28 | + .click() |
| 29 | + .should('have.class', Classes.INTENT_PRIMARY) |
| 30 | + .then(() => { |
| 31 | + cy.get('.data-cy-explorer-tab') |
| 32 | + .should('not.have.class', Classes.INTENT_PRIMARY); |
| 33 | + |
| 34 | + cy.get(".downloads").should("exist"); |
| 35 | + cy.get(".sideview.active").should("not.be.visible"); |
| 36 | + }); |
| 37 | + |
| 38 | + cy.get('.data-cy-explorer-tab') |
| 39 | + .click() |
| 40 | + .should('have.class', Classes.INTENT_PRIMARY) |
| 41 | + .then(() => { |
| 42 | + cy.get('.data-cy-downloads-tab') |
| 43 | + .should('not.have.class', Classes.INTENT_PRIMARY); |
| 44 | + |
| 45 | + cy.get(".downloads").should("not.exist"); |
| 46 | + cy.get(".sideview.active").should("be.visible"); |
| 47 | + }); |
| 48 | + }); |
| 49 | + |
| 50 | + it('click on dual should toggle dual view', () => { |
| 51 | + cy.get('.data-cy-toggle-splitview') |
| 52 | + .click() |
| 53 | + .should('have.class', Classes.INTENT_PRIMARY) |
| 54 | + .should('have.class', Classes.ACTIVE); |
| 55 | + |
| 56 | + cy.get('#view_1') |
| 57 | + .should('be.visible'); |
| 58 | + |
| 59 | + cy.get('.data-cy-toggle-splitview') |
| 60 | + .click() |
| 61 | + .should('not.have.class', Classes.INTENT_PRIMARY) |
| 62 | + .should('not.have.class', Classes.ACTIVE); |
| 63 | + |
| 64 | + cy.get('#view_1') |
| 65 | + .should('not.be.visible'); |
| 66 | + }); |
| 67 | + |
| 68 | + it('click on app menu should toggle app menu', () => { |
| 69 | + cy.get('.data-cy-toggle-app-menu') |
| 70 | + .click() |
| 71 | + .should('have.class', Classes.ACTIVE); |
| 72 | + |
| 73 | + cy.get('.data-cy-app-menu') |
| 74 | + .should('be.visible'); |
| 75 | + |
| 76 | + cy.get('.data-cy-toggle-app-menu') |
| 77 | + .click() |
| 78 | + .should('not.have.class', Classes.ACTIVE); |
| 79 | + |
| 80 | + cy.get('.data-cy-app-menu') |
| 81 | + .should('not.be.visible'); |
| 82 | + }); |
| 83 | +}); |
0 commit comments