diff options
author | Vinicius Reis <vinicius.reis@nextcloud.com> | 2022-07-28 20:29:07 +0300 |
---|---|---|
committer | Vinicius Reis <vinicius.reis@nextcloud.com> | 2022-07-28 20:29:07 +0300 |
commit | 0b30ad4dcf49a83c183ac373e01fec5d5157523a (patch) | |
tree | 772195ebe12e9b707fdd27dfc98917d367059899 | |
parent | 308cc046b9227128e85a3d1c8891850bf1a5f66d (diff) |
✅ improve test and remove unnecessary codefix/noid/nc25-sharing-changes
Signed-off-by: Vinicius Reis <vinicius.reis@nextcloud.com>
-rw-r--r-- | cypress/e2e/share.spec.js | 86 |
1 files changed, 37 insertions, 49 deletions
diff --git a/cypress/e2e/share.spec.js b/cypress/e2e/share.spec.js index 1f0c06687..75e55d348 100644 --- a/cypress/e2e/share.spec.js +++ b/cypress/e2e/share.spec.js @@ -54,15 +54,12 @@ describe('Open test.md in viewer', function() { cy.get('#app-sidebar-vue button.new-share-link').trigger('click') cy.get('#app-sidebar-vue a.sharing-entry__copy') .should('have.attr', 'href').and('include', '/s/') - .then((href) => { - cy.visit(href) - cy.window().then(win => { - win.OC.appswebroots.files_texteditor = true - cy.getEditor().should('be.visible') - cy.getContent() - .should('contain', 'Hello world') - .find('h2').should('contain', 'Hello world') - }) + .then((href) => cy.visit(href)) + .then(() => { + cy.getEditor().should('be.visible') + cy.getContent() + .should('contain', 'Hello world') + .find('h2').should('contain', 'Hello world') }) }) @@ -80,20 +77,17 @@ describe('Open test.md in viewer', function() { cy.get(checkboxAllowEditing).first().should('be.checked') cy.get('#app-sidebar-vue a.sharing-entry__copy') .should('have.attr', 'href').and('include', '/s/') - .then((href) => { - cy.visit(href) - cy.window().then(win => { - win.OC.appswebroots.files_texteditor = true - cy.getEditor().should('be.visible') - cy.getContent() - .should('contain', 'Hello world') - .find('h2').should('contain', 'Hello world') + .then((href) => cy.visit(href)) + .then(() => { + cy.getEditor().should('be.visible') + cy.getContent() + .should('contain', 'Hello world') + .find('h2').should('contain', 'Hello world') - cy.getMenu().should('be.visible') - cy.getActionEntry('undo').should('be.visible') - cy.getActionEntry('redo').should('be.visible') - cy.getActionEntry('bold').should('be.visible') - }) + cy.getMenu().should('be.visible') + cy.getActionEntry('undo').should('be.visible') + cy.getActionEntry('redo').should('be.visible') + cy.getActionEntry('bold').should('be.visible') }) }) @@ -107,22 +101,19 @@ describe('Open test.md in viewer', function() { cy.get('#app-sidebar-vue a.sharing-entry__copy') .should('have.attr', 'href').and('include', '/s/') .then((href) => { - cy.logout() - cy.visit(href) - cy.window().then(win => { - win.OC.appswebroots.files_texteditor = true - // eslint-disable-next-line cypress/no-unnecessary-waiting - cy.wait(1000) - cy.getEditor().should('be.visible') - cy.getContent() - .should('contain', 'Hello world') - .find('h2').should('contain', 'Hello world') + return cy.logout() + .then(() => cy.visit(href)) + }) + .then(() => { + cy.getEditor().should('be.visible') + cy.getContent() + .should('contain', 'Hello world') + .find('h2').should('contain', 'Hello world') - cy.getMenu().should('be.visible') - cy.getActionEntry('undo').should('be.visible') - cy.getActionEntry('redo').should('be.visible') - cy.getActionEntry('bold').should('be.visible') - }) + cy.getMenu().should('be.visible') + cy.getActionEntry('undo').should('be.visible') + cy.getActionEntry('redo').should('be.visible') + cy.getActionEntry('bold').should('be.visible') }) }) @@ -136,18 +127,15 @@ describe('Open test.md in viewer', function() { cy.get('#app-sidebar-vue button.new-share-link').trigger('click') cy.get('#app-sidebar-vue a.sharing-entry__copy') .should('have.attr', 'href').and('include', '/s/') - .then((href) => { - cy.visit(href) - cy.window().then(win => { - win.OC.appswebroots.files_texteditor = true - cy.get('#rich-workspace').should('contain', 'Hello world') - cy.openFile('test.md') - cy.get('#editor-container').should('be.visible') - cy.get('#editor .ProseMirror').should('contain', 'Hello world') - cy.get('#editor .ProseMirror h2').should('contain', 'Hello world') - cy.get('.modal-header button.header-close').click() - cy.get('.modal-mask').should('not.exist') - }) + .then((href) => cy.visit(href)) + .then(() => { + cy.get('#rich-workspace').should('contain', 'Hello world') + cy.openFile('test.md') + cy.get('#editor-container').should('be.visible') + cy.get('#editor .ProseMirror').should('contain', 'Hello world') + cy.get('#editor .ProseMirror h2').should('contain', 'Hello world') + cy.get('.modal-header button.header-close').click() + cy.get('.modal-mask').should('not.exist') }) }) |