Skip to content

Commit 9e9288b

Browse files
committed
text(cypress): Test browser refresh warning after document session cleanup
Signed-off-by: Jonas <jonas@freesources.org>
1 parent aac9123 commit 9e9288b

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

cypress/e2e/sync.spec.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,25 @@ describe('Sync', () => {
126126
.should('include', 'after the lost connection')
127127
})
128128

129+
it.only('shows warning when document session got cleaned up', () => {
130+
cy.get('.save-status button')
131+
.click()
132+
cy.wait('@save')
133+
cy.uploadTestFile('test.md')
134+
135+
cy.get('#editor-container .document-status', { timeout: 30000 })
136+
.should('contain', 'Editing session has expired.')
137+
138+
// Reload button works
139+
cy.get('#editor-container .document-status a.button')
140+
.contains('Reload')
141+
.click()
142+
143+
cy.getContent()
144+
cy.get('#editor-container .document-status .notecard')
145+
.should('not.exist')
146+
})
147+
129148
it('passes the doc content from one session to the next', () => {
130149
cy.closeFile()
131150
cy.intercept({ method: 'PUT', url: '**/apps/text/session/*/create' })

0 commit comments

Comments
 (0)