From 819cb01e0e0c509283c9eaf534abbfeeab98a752 Mon Sep 17 00:00:00 2001 From: Johannes Rieken Date: Mon, 15 Mar 2021 08:58:55 +0100 Subject: [PATCH] make notebook integration test more stable, fixes https://github.com/microsoft/vscode/issues/118889 --- .../src/singlefolder-tests/notebook.editor.test.ts | 8 ++++++++ .../src/singlefolder-tests/notebook.test.ts | 8 ++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/notebook.editor.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/notebook.editor.test.ts index 9fccde765f9..fb6282084d8 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/notebook.editor.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/notebook.editor.test.ts @@ -67,4 +67,12 @@ suite('Notebook Editor', function () { assert.strictEqual(count1 + 1, count2); }); + + test('Opening a notebook should fire activeNotebook event changed only once', async function () { + const openedEditor = utils.asPromise(vscode.window.onDidChangeActiveNotebookEditor); + const resource = await utils.createRandomFile(undefined, undefined, '.vsctestnb'); + const editor = await vscode.window.showNotebookDocument(resource); + assert.ok(await openedEditor); + assert.strictEqual(editor.document.uri.toString(), resource.toString()); + }); }); diff --git a/extensions/vscode-api-tests/src/singlefolder-tests/notebook.test.ts b/extensions/vscode-api-tests/src/singlefolder-tests/notebook.test.ts index 01c682f5678..72e771489bc 100644 --- a/extensions/vscode-api-tests/src/singlefolder-tests/notebook.test.ts +++ b/extensions/vscode-api-tests/src/singlefolder-tests/notebook.test.ts @@ -1132,12 +1132,8 @@ suite('Notebook API tests', function () { assert.strictEqual(document.cells[0].metadata.executionOrder, executionOrder); assert.strictEqual(document.cells[0].metadata.runState, vscode.NotebookCellRunState.Success); }); - test('Opening a notebook should fire activeNotebook event changed only once', async function () { - const openedEditor = asPromise(vscode.window.onDidChangeActiveNotebookEditor); - const resource = await createRandomFile('', undefined, '.vsctestnb'); - await vscode.notebook.openNotebookDocument(resource); - assert.ok(await openedEditor); - }); + + // });