@@ -108,7 +108,10 @@ describe('Sync', () => {
108108 'contain' ,
109109 'The document could not be loaded.' ,
110110 )
111+ cy . intercept ( '**/apps/text/session/*/create' ) . as ( 'create' )
111112 cy . get ( '#editor-container .document-status' ) . find ( '.button.primary' ) . click ( )
113+ // let first attempt fail
114+ cy . wait ( '@create' , { timeout : 10000 } )
112115 cy . get ( '#editor-container .document-status' , { timeout : 30000 } ) . should (
113116 'contain' ,
114117 'The document could not be loaded.' ,
@@ -117,7 +120,6 @@ describe('Sync', () => {
117120 cy . intercept ( '**/apps/text/session/*/*' , ( req ) => {
118121 req . continue ( )
119122 } ) . as ( 'alive' )
120- cy . intercept ( '**/apps/text/session/*/create' ) . as ( 'create' )
121123 cy . get ( '#editor-container .document-status' ) . find ( '.button.primary' ) . click ( )
122124 cy . wait ( '@alive' , { timeout : 30000 } )
123125 cy . wait ( '@create' , { timeout : 10000 } )
@@ -176,18 +178,9 @@ describe('Sync', () => {
176178 cy . wait ( '@save' )
177179 cy . uploadTestFile ( 'test.md' )
178180
179- cy . get ( '#editor-container .document-status' , { timeout : 30000 } ) . should (
180- 'contain' ,
181- 'Editing session has expired.' ,
182- )
183-
184- // Reload button works
185- cy . get ( '#editor-container .document-status a.button' )
186- . contains ( 'Reload' )
187- . click ( )
188-
189- cy . getContent ( )
190- cy . get ( '#editor-container .document-status .notecard' ) . should ( 'not.exist' )
181+ cy . getContent ( ) . should ( 'not.exist' )
182+ cy . getContent ( ) . find ( 'h2' ) . should ( 'contain' , 'Hello world' )
183+ cy . getContent ( ) . find ( 'li' ) . should ( 'not.exist' ) // was overwritten after the save
191184 } )
192185
193186 it ( 'passes the doc content from one session to the next' , ( ) => {
0 commit comments