From 2891fd02552dfd50ebc844580274841b33e198e1 Mon Sep 17 00:00:00 2001 From: Max Date: Thu, 24 Feb 2022 16:25:34 +0100 Subject: fix: do not try to send steps to a read only doc Cypress tests were failing because they triggered editor.focus on a read only doc. Focus seems to cause sendable steps - maybe because the current cursor changes. Prevent this on various levels: * Do not autofocus read only docs. * Do not send steps to read only docs. * Handle server response with 403 without content gracefully when sending steps. The last originated here: https://github.com/nextcloud/text/blob/master/lib/Service/ApiService.php#L158 So wither the session was not valid or the document read only. Not entirely sure what best to do in this situation. Logging to console.error for now. Signed-off-by: Max --- cypress/integration/share.spec.js | 1 - 1 file changed, 1 deletion(-) (limited to 'cypress') diff --git a/cypress/integration/share.spec.js b/cypress/integration/share.spec.js index ffc9ffbb0..d556a6ef0 100644 --- a/cypress/integration/share.spec.js +++ b/cypress/integration/share.spec.js @@ -59,7 +59,6 @@ describe('Open test.md in viewer', function() { cy.visit(href) cy.window().then(win => { win.OC.appswebroots['files_texteditor'] = true - cy.wait(1000) cy.get('#editor').should('be.visible') cy.get('#editor .ProseMirror').should('contain', 'Hello world') cy.get('#editor .ProseMirror h2').should('contain', 'Hello world') -- cgit v1.2.3