make notebook integration test more stable, fixes https://github.com/microsoft/vscode/issues/118889

This commit is contained in:
Johannes Rieken 2021-03-15 08:58:55 +01:00
parent 84fe402d65
commit 819cb01e0e
No known key found for this signature in database
GPG key ID: 96634B5AF12F8798
2 changed files with 10 additions and 6 deletions

View file

@ -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());
});
});

View file

@ -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);
});
// });