Skip to content

Commit 8b3b3d1

Browse files
committed
Add cypress tests for switching views with rich workspaces
Signed-off-by: Julius Härtl <jus@bitgrid.net>
1 parent c412fd8 commit 8b3b3d1

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

cypress/e2e/workspace.spec.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,32 @@ describe('Workspace', function() {
4343
})
4444
})
4545

46+
it('Hides the workspace when switching to another folder', function() {
47+
cy.uploadFile('test.md', 'text/markdown', `${Cypress.currentTest.title}/README.md`)
48+
cy.createFolder(`${Cypress.currentTest.title}/subdirectory`)
49+
cy.reload()
50+
cy.get('.files-fileList').should('contain', 'README.md')
51+
cy.get('#rich-workspace .ProseMirror')
52+
.should('contain', 'Hello world')
53+
cy.openFolder('subdirectory')
54+
cy.get('#rich-workspace')
55+
.get('.ProseMirror')
56+
.should('not.exist')
57+
})
58+
59+
it('Hides the workspace when switching to another view', function() {
60+
cy.uploadFile('test.md', 'text/markdown', `${Cypress.currentTest.title}/README.md`)
61+
cy.reload()
62+
cy.get('.files-fileList').should('contain', 'README.md')
63+
cy.get('#rich-workspace .ProseMirror')
64+
.should('contain', 'Hello world')
65+
cy.get('.nav-recent')
66+
.click()
67+
cy.get('#rich-workspace')
68+
.get('.ProseMirror')
69+
.should('not.exist')
70+
})
71+
4672
it('adds a Readme.md', function() {
4773
cy.get('.files-fileList').should('not.contain', 'Readme.md')
4874
cy.openWorkspace()

0 commit comments

Comments
 (0)