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 <[email protected]>
  • Loading branch information
mejo- committed Mar 27, 2024
1 parent ca0f8ed commit 9126a73
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 @@ -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' })
Expand Down

0 comments on commit 9126a73

Please sign in to comment.