@@ -74,7 +74,7 @@ describe('Sync', () => {
7474 } ) . as ( 'sessionRequests' )
7575 cy . wait ( '@dead' , { timeout : 30000 } )
7676 cy . get ( '#editor-container .document-status' , { timeout : 30000 } )
77- . should ( 'contain' , 'File could not be loaded' )
77+ . should ( 'contain' , 'Document could not be loaded. ' )
7878 . then ( ( ) => {
7979 reconnect = true
8080 } )
@@ -83,7 +83,7 @@ describe('Sync', () => {
8383 . as ( 'syncAfterRecovery' )
8484 cy . wait ( '@syncAfterRecovery' , { timeout : 30000 } )
8585 cy . get ( '#editor-container .document-status' , { timeout : 30000 } )
86- . should ( 'not.contain' , 'File could not be loaded' )
86+ . should ( 'not.contain' , 'Document could not be loaded. ' )
8787 // FIXME: There seems to be a bug where typed words maybe lost if not waiting for the new session
8888 cy . wait ( '@syncAfterRecovery' , { timeout : 10000 } )
8989 cy . getContent ( ) . type ( '* more content added after the lost connection{enter}' )
@@ -109,12 +109,12 @@ describe('Sync', () => {
109109
110110 cy . wait ( '@sessionRequests' , { timeout : 30000 } )
111111 cy . get ( '#editor-container .document-status' , { timeout : 30000 } )
112- . should ( 'contain' , 'File could not be loaded' )
112+ . should ( 'contain' , 'Document could not be loaded. ' )
113113
114114 cy . wait ( '@syncAfterRecovery' , { timeout : 60000 } )
115115
116116 cy . get ( '#editor-container .document-status' , { timeout : 30000 } )
117- . should ( 'not.contain' , 'File could not be loaded' )
117+ . should ( 'not.contain' , 'Document could not be loaded. ' )
118118 // FIXME: There seems to be a bug where typed words maybe lost if not waiting for the new session
119119 cy . wait ( '@syncAfterRecovery' , { timeout : 10000 } )
120120 cy . getContent ( ) . type ( '* more content added after the lost connection{enter}' )
@@ -126,6 +126,25 @@ describe('Sync', () => {
126126 . should ( 'include' , 'after the lost connection' )
127127 } )
128128
129+ it ( '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