From 9126a7355d6779ef5aa2a4f45e2b91eb79877b56 Mon Sep 17 00:00:00 2001 From: Jonas Date: Wed, 20 Mar 2024 15:51:35 +0100 Subject: [PATCH] text(cypress): Test browser refresh warning after document session cleanup Signed-off-by: Jonas --- cypress/e2e/sync.spec.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/cypress/e2e/sync.spec.js b/cypress/e2e/sync.spec.js index 582157cff3a..c6338d82804 100644 --- a/cypress/e2e/sync.spec.js +++ b/cypress/e2e/sync.spec.js @@ -126,6 +126,25 @@ describe('Sync', () => { .should('include', 'after the lost connection') }) + it('shows warning when document session got cleaned up', () => { + cy.get('.save-status button') + .click() + cy.wait('@save') + cy.uploadTestFile('test.md') + + cy.get('#editor-container .document-status', { timeout: 30000 }) + .should('contain', 'Editing session has expired.') + + // Reload button works + cy.get('#editor-container .document-status a.button') + .contains('Reload') + .click() + + cy.getContent() + cy.get('#editor-container .document-status .notecard') + .should('not.exist') + }) + it('passes the doc content from one session to the next', () => { cy.closeFile() cy.intercept({ method: 'PUT', url: '**/apps/text/session/*/create' })