Skip to content

Commit 5175811

Browse files
authored
Merge pull request #5099 from nextcloud/backport/feature/hide-share-and-close-buttons-on-direct-editing-stable27
2 parents 00698a7 + 7bb1d4a commit 5175811

14 files changed

Lines changed: 27 additions & 64 deletions

cypress/e2e/directediting.spec.js

Lines changed: 3 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -53,83 +53,41 @@ describe('direct editing', function() {
5353
initUserAndFiles(user, 'test.md', 'empty.md', 'empty.txt')
5454
})
5555

56-
it('Open an existing file, edit and close it', () => {
56+
it('Open an existing file, edit it', () => {
5757
createDirectEditingLink(user, 'empty.md')
5858
.then((token) => {
5959
cy.logout()
6060
cy.visit(token)
6161
})
62-
const closeRequestAlias = 'closeRequest'
63-
cy.intercept({ method: 'POST', url: '**/session/close' }).as(closeRequestAlias)
64-
cy.intercept({ method: 'POST', url: '**/apps/text/session/sync' }).as('sync')
6562
cy.getContent().type('# This is a headline')
6663
cy.getContent().type('{enter}')
6764
cy.getContent().type('Some text')
6865
cy.getContent().type('{enter}')
69-
70-
// ensure we have received our own steps
71-
cy.wait('@sync', { timeout: 7000 })
72-
cy.wait('@sync', { timeout: 7000 })
73-
74-
cy.get('button.icon-close').click()
75-
cy.wait(`@${closeRequestAlias}`).then(() => {
76-
cy.getFileContent('empty.md').then((content) => {
77-
expect(content).to.equal('# This is a headline\n\nSome text')
78-
})
79-
})
8066
})
8167

82-
it('Create a file, edit and close it', () => {
68+
it('Create a file, edit it', () => {
8369
createDirectEditingLinkForNewFile(user, 'newfile.md')
8470
.then((token) => {
8571
cy.logout()
8672
cy.visit(token)
8773
})
88-
const closeRequestAlias = 'closeRequest'
89-
cy.intercept({ method: 'POST', url: '**/session/close' }).as(closeRequestAlias)
90-
cy.intercept({ method: 'POST', url: '**/apps/text/session/sync' }).as('sync')
9174

9275
cy.getContent().type('# This is a headline')
9376
cy.getContent().type('{enter}')
9477
cy.getContent().type('Some text')
9578
cy.getContent().type('{enter}')
96-
97-
// ensure we have received our own steps
98-
cy.wait('@sync', { timeout: 7000 })
99-
cy.wait('@sync', { timeout: 7000 })
100-
101-
cy.get('button.icon-close').click()
102-
cy.wait(`@${closeRequestAlias}`).then(() => {
103-
cy.getFileContent('newfile.md').then((content) => {
104-
expect(content).to.equal('# This is a headline\n\nSome text')
105-
})
106-
})
10779
})
10880

109-
it('Open an existing plain text file, edit and close it', () => {
81+
it('Open an existing plain text file, edit it', () => {
11082
createDirectEditingLink(user, 'empty.txt')
11183
.then((token) => {
11284
cy.logout()
11385
cy.visit(token)
11486
})
115-
const closeRequestAlias = 'closeRequest'
116-
cy.intercept({ method: 'POST', url: '**/session/close' }).as(closeRequestAlias)
117-
cy.intercept({ method: 'POST', url: '**/apps/text/session/sync' }).as('sync')
11887

11988
cy.getContent().type('# This is a headline')
12089
cy.getContent().type('{enter}')
12190
cy.getContent().type('Some text')
12291
cy.getContent().type('{enter}')
123-
124-
// ensure we have received our own steps
125-
cy.wait('@sync', { timeout: 7000 })
126-
cy.wait('@sync', { timeout: 7000 })
127-
128-
cy.get('button.icon-close').click()
129-
cy.wait(`@${closeRequestAlias}`).then(() => {
130-
cy.getFileContent('empty.txt').then((content) => {
131-
expect(content).to.equal('# This is a headline\nSome text\n')
132-
})
133-
})
13492
})
13593
})

js/editor.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/editor.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/text-editors.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/text-editors.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/text-files.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/text-files.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/text-public.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/text-public.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

js/text-text.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)