From 4bf23338da8c0e18a95ac9c10b530876ffe7f7c6 Mon Sep 17 00:00:00 2001 From: Luka Trovic Date: Thu, 22 Jun 2023 19:33:08 +0200 Subject: [PATCH] feat: hide share and close buttons on direct editing for desktop Signed-off-by: Luka Trovic --- cypress/e2e/directediting.spec.js | 33 +++---------------------------- src/views/DirectEditing.vue | 7 ++++++- 2 files changed, 9 insertions(+), 31 deletions(-) diff --git a/cypress/e2e/directediting.spec.js b/cypress/e2e/directediting.spec.js index c59a7a8abec..79047119757 100644 --- a/cypress/e2e/directediting.spec.js +++ b/cypress/e2e/directediting.spec.js @@ -53,68 +53,41 @@ describe('direct editing', function() { initUserAndFiles(user, 'test.md', 'empty.md', 'empty.txt') }) - it('Open an existing file, edit and close it', () => { + it('Open an existing file, edit it', () => { createDirectEditingLink(user, 'empty.md') .then((token) => { cy.logout() cy.visit(token) }) - const closeRequestAlias = 'closeRequest' - cy.intercept({ method: 'POST', url: '**/session/close' }).as(closeRequestAlias) cy.getContent().type('# This is a headline') cy.getContent().type('{enter}') cy.getContent().type('Some text') cy.getContent().type('{enter}') - - cy.get('button.icon-close').click() - cy.wait(`@${closeRequestAlias}`).then(() => { - cy.getFileContent('empty.md').then((content) => { - expect(content).to.equal('# This is a headline\n\nSome text') - }) - }) }) - it('Create a file, edit and close it', () => { + it('Create a file, edit it', () => { createDirectEditingLinkForNewFile(user, 'newfile.md') .then((token) => { cy.logout() cy.visit(token) }) - const closeRequestAlias = 'closeRequest' - cy.intercept({ method: 'POST', url: '**/session/close' }).as(closeRequestAlias) cy.getContent().type('# This is a headline') cy.getContent().type('{enter}') cy.getContent().type('Some text') cy.getContent().type('{enter}') - - cy.get('button.icon-close').click() - cy.wait(`@${closeRequestAlias}`).then(() => { - cy.getFileContent('newfile.md').then((content) => { - expect(content).to.equal('# This is a headline\n\nSome text') - }) - }) }) - it('Open an existing plain text file, edit and close it', () => { + it('Open an existing plain text file, edit it', () => { createDirectEditingLink(user, 'empty.txt') .then((token) => { cy.logout() cy.visit(token) }) - const closeRequestAlias = 'closeRequest' - cy.intercept({ method: 'POST', url: '**/session/close' }).as(closeRequestAlias) cy.getContent().type('# This is a headline') cy.getContent().type('{enter}') cy.getContent().type('Some text') cy.getContent().type('{enter}') - - cy.get('button.icon-close').click() - cy.wait(`@${closeRequestAlias}`).then(() => { - cy.getFileContent('empty.txt').then((content) => { - expect(content).to.equal('# This is a headline\nSome text\n') - }) - }) }) }) diff --git a/src/views/DirectEditing.vue b/src/views/DirectEditing.vue index 9f7330cac51..0443f7abd28 100644 --- a/src/views/DirectEditing.vue +++ b/src/views/DirectEditing.vue @@ -29,7 +29,7 @@ :mime="initial.mimetype" :is-direct-editing="true" @ready="loaded"> -