@@ -253,13 +253,15 @@ for _ in range(50):
253
253
assert . equal ( saveCalled , true , 'Save should have been called' ) ;
254
254
255
255
// Click export and wait for a document to change
256
- const documentChange = createDeferred ( ) ;
256
+ const activeTextEditorChange = createDeferred ( ) ;
257
257
const docManager = ioc . get < IDocumentManager > ( IDocumentManager ) as MockDocumentManager ;
258
- docManager . onDidChangeTextDocument ( ( ) => documentChange . resolve ( ) ) ;
258
+ docManager . onDidChangeActiveTextEditor ( ( ) => activeTextEditorChange . resolve ( ) ) ;
259
259
const exportButton = findButton ( wrapper , NativeEditor , 9 ) ;
260
260
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
+
263
265
// Verify the new document is valid python
264
266
const newDoc = docManager . activeTextEditor ;
265
267
assert . ok ( newDoc , 'New doc not created' ) ;
@@ -1228,7 +1230,7 @@ for _ in range(50):
1228
1230
1229
1231
// Now that the notebook is dirty, change the active editor.
1230
1232
const docManager = ioc . get < IDocumentManager > ( IDocumentManager ) as MockDocumentManager ;
1231
- docManager . didChangeEmitter . fire ( ) ;
1233
+ docManager . didChangeActiveTextEditorEmitter . fire ( ) ;
1232
1234
// Also, send notification about changes to window state.
1233
1235
windowStateChangeHandlers . forEach ( item => item ( { focused : false } ) ) ;
1234
1236
windowStateChangeHandlers . forEach ( item => item ( { focused : true } ) ) ;
@@ -1251,7 +1253,7 @@ for _ in range(50):
1251
1253
1252
1254
// Now that the notebook is dirty, change the active editor.
1253
1255
const docManager = ioc . get < IDocumentManager > ( IDocumentManager ) as MockDocumentManager ;
1254
- docManager . didChangeEmitter . fire ( newEditor ) ;
1256
+ docManager . didChangeActiveTextEditorEmitter . fire ( newEditor ) ;
1255
1257
1256
1258
// At this point a message should be sent to extension asking it to save.
1257
1259
// 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):
1279
1281
// Now that the notebook is dirty, change the active editor.
1280
1282
// This should not trigger a save of notebook (as its configured to save only when window state changes).
1281
1283
const docManager = ioc . get < IDocumentManager > ( IDocumentManager ) as MockDocumentManager ;
1282
- docManager . didChangeEmitter . fire ( ) ;
1284
+ docManager . didChangeActiveTextEditorEmitter . fire ( ) ;
1283
1285
1284
1286
// Confirm the message is not clean, trying to wait for it to get saved will timeout (i.e. rejected).
1285
1287
await expect ( waitForNotebookToBeClean ( ) ) . to . eventually . be . rejected ;
0 commit comments