Skip to content

Commit

Permalink
text(cypress): Test browser refresh warning after document session cl…
Browse files Browse the repository at this point in the history
…eanup

Signed-off-by: Jonas <jonas@freesources.org>
  • Loading branch information
mejo- authored and backportbot[bot] committed Mar 21, 2024
1 parent b827680 commit 59bb574
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions cypress/e2e/sync.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,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' })
Expand Down

0 comments on commit 59bb574

Please sign in to comment.