Re #125369. Reduce commands in nb integration test. (#169684)

Re #125369. Reduce commands
This commit is contained in:
Peng Lyu
2022-12-20 13:47:01 -08:00
committed by GitHub
parent a8900c4ae0
commit bf6305fb52
2 changed files with 4 additions and 3 deletions

View File

@@ -183,7 +183,6 @@ const apiTestSerializer: vscode.NotebookSerializer = {
// opening a cell-uri opens a notebook editor
await vscode.window.showTextDocument(cell.document, { viewColumn: vscode.ViewColumn.Active });
// await vscode.commands.executeCommand('vscode.open', cell.document.uri, vscode.ViewColumn.Active);
assert.strictEqual(!!vscode.window.activeNotebookEditor, true);
assert.strictEqual(vscode.window.activeNotebookEditor!.notebook.uri.toString(), document.uri.toString());
@@ -224,7 +223,8 @@ const apiTestSerializer: vscode.NotebookSerializer = {
});
test('#102411 - untitled notebook creation failed', async function () {
await vscode.commands.executeCommand('workbench.action.files.newUntitledFile', { viewType: notebookType });
const document = await vscode.workspace.openNotebookDocument(notebookType, undefined);
await vscode.window.showNotebookDocument(document);
assert.notStrictEqual(vscode.window.activeNotebookEditor, undefined, 'untitled notebook editor is not undefined');
await closeAllEditors();

View File

@@ -178,7 +178,8 @@ const apiTestSerializer: vscode.NotebookSerializer = {
});
const secondResource = await createRandomNotebookFile();
await vscode.commands.executeCommand('vscode.openWith', secondResource, 'notebookCoreTest');
const secondDocument = await vscode.workspace.openNotebookDocument(secondResource);
await vscode.window.showNotebookDocument(secondDocument);
await withEvent<vscode.NotebookDocumentChangeEvent>(vscode.workspace.onDidChangeNotebookDocument, async event => {
await vscode.commands.executeCommand('notebook.cell.execute', { start: 0, end: 1 }, notebook.uri);