@@ -253,13 +253,15 @@ for _ in range(50):
253253 assert . equal ( saveCalled , true , 'Save should have been called' ) ;
254254
255255 // Click export and wait for a document to change
256- const documentChange = createDeferred ( ) ;
256+ const activeTextEditorChange = createDeferred ( ) ;
257257 const docManager = ioc . get < IDocumentManager > ( IDocumentManager ) as MockDocumentManager ;
258- docManager . onDidChangeTextDocument ( ( ) => documentChange . resolve ( ) ) ;
258+ docManager . onDidChangeActiveTextEditor ( ( ) => activeTextEditorChange . resolve ( ) ) ;
259259 const exportButton = findButton ( wrapper , NativeEditor , 9 ) ;
260260 await waitForMessageResponse ( ioc , ( ) => exportButton ! . simulate ( 'click' ) ) ;
261- // This can be slow, hence wait for a max of 5.
262- await waitForPromise ( documentChange . promise , 5_000 ) ;
261+
262+ // This can be slow, hence wait for a max of 15.
263+ await waitForPromise ( activeTextEditorChange . promise , 15_000 ) ;
264+
263265 // Verify the new document is valid python
264266 const newDoc = docManager . activeTextEditor ;
265267 assert . ok ( newDoc , 'New doc not created' ) ;
@@ -1228,7 +1230,7 @@ for _ in range(50):
12281230
12291231 // Now that the notebook is dirty, change the active editor.
12301232 const docManager = ioc . get < IDocumentManager > ( IDocumentManager ) as MockDocumentManager ;
1231- docManager . didChangeEmitter . fire ( ) ;
1233+ docManager . didChangeActiveTextEditorEmitter . fire ( ) ;
12321234 // Also, send notification about changes to window state.
12331235 windowStateChangeHandlers . forEach ( item => item ( { focused : false } ) ) ;
12341236 windowStateChangeHandlers . forEach ( item => item ( { focused : true } ) ) ;
@@ -1251,7 +1253,7 @@ for _ in range(50):
12511253
12521254 // Now that the notebook is dirty, change the active editor.
12531255 const docManager = ioc . get < IDocumentManager > ( IDocumentManager ) as MockDocumentManager ;
1254- docManager . didChangeEmitter . fire ( newEditor ) ;
1256+ docManager . didChangeActiveTextEditorEmitter . fire ( newEditor ) ;
12551257
12561258 // At this point a message should be sent to extension asking it to save.
12571259 // After the save, the extension should send a message to react letting it know that it was saved successfully.
@@ -1279,7 +1281,7 @@ for _ in range(50):
12791281 // Now that the notebook is dirty, change the active editor.
12801282 // This should not trigger a save of notebook (as its configured to save only when window state changes).
12811283 const docManager = ioc . get < IDocumentManager > ( IDocumentManager ) as MockDocumentManager ;
1282- docManager . didChangeEmitter . fire ( ) ;
1284+ docManager . didChangeActiveTextEditorEmitter . fire ( ) ;
12831285
12841286 // Confirm the message is not clean, trying to wait for it to get saved will timeout (i.e. rejected).
12851287 await expect ( waitForNotebookToBeClean ( ) ) . to . eventually . be . rejected ;
0 commit comments