remove outdated test

This commit is contained in:
rebornix
2022-08-03 10:08:02 -07:00
parent 57599a9ecd
commit 82314b9ed5
3 changed files with 12 additions and 44 deletions

View File

@@ -164,17 +164,6 @@ const apiTestContentProvider: vscode.NotebookContentProvider = {
await saveAllFilesAndCloseAll();
});
test('edit API batch edits', async function () {
const notebook = await openRandomNotebookDocument();
const edit = new vscode.WorkspaceEdit();
const metdataEdit = vscode.NotebookEdit.updateNotebookMetadata({ ...notebook.metadata, custom: { ...(notebook.metadata.custom || {}), extraNotebookMetadata: true } });
edit.set(notebook.uri, [metdataEdit]);
const success = await vscode.workspace.applyEdit(edit);
assert.equal(success, true);
assert.ok(notebook.metadata.custom.extraNotebookMetadata, `Test metadata not found`);
});
test('notebook open', async function () {
const notebook = await openRandomNotebookDocument();
const editor = await vscode.window.showNotebookDocument(notebook);

View File

@@ -315,6 +315,18 @@ suite('Notebook Document', function () {
assert.strictEqual(data.cellChanges[0].cell.index, 0);
});
test('workspace edit API (notebookMetadata)', async function () {
const uri = await utils.createRandomFile(undefined, undefined, '.nbdtest');
const document = await vscode.workspace.openNotebookDocument(uri);
const edit = new vscode.WorkspaceEdit();
const metdataEdit = vscode.NotebookEdit.updateNotebookMetadata({ ...document.metadata, custom: { ...(document.metadata.custom || {}), extraNotebookMetadata: true } });
edit.set(document.uri, [metdataEdit]);
const success = await vscode.workspace.applyEdit(edit);
assert.equal(success, true);
assert.ok(document.metadata.custom.extraNotebookMetadata, `Test metadata not found`);
});
test('document save API', async function () {
const uri = await utils.createRandomFile(undefined, undefined, '.nbdtest');
const notebook = await vscode.workspace.openNotebookDocument(uri);

View File

@@ -65,39 +65,6 @@ import * as utils from '../utils';
testDisposables.length = 0;
});
test.skip('showNotebookDocument', async function () { // TODO@rebornix https://github.com/microsoft/vscode/issues/139078
const notebookDocumentsFromOnDidOpen = new Set<vscode.NotebookDocument>();
const sub = vscode.workspace.onDidOpenNotebookDocument(e => {
notebookDocumentsFromOnDidOpen.add(e);
});
const uri = await utils.createRandomFile(undefined, undefined, '.nbdtest');
const editor = await vscode.window.showNotebookDocument(uri);
assert.strictEqual(uri.toString(), editor.notebook.uri.toString());
assert.strictEqual(notebookDocumentsFromOnDidOpen.has(editor.notebook), true);
const includes = vscode.workspace.notebookDocuments.includes(editor.notebook);
assert.strictEqual(true, includes);
sub.dispose();
});
// TODO@rebornix deal with getting started
test.skip('notebook editor has viewColumn', async function () {
const uri1 = await utils.createRandomFile(undefined, undefined, '.nbdtest');
const editor1 = await vscode.window.showNotebookDocument(uri1);
assert.strictEqual(editor1.viewColumn, vscode.ViewColumn.One);
const uri2 = await utils.createRandomFile(undefined, undefined, '.nbdtest');
const editor2 = await vscode.window.showNotebookDocument(uri2, { viewColumn: vscode.ViewColumn.Beside });
assert.strictEqual(editor2.viewColumn, vscode.ViewColumn.Two);
});
// #138683
test('Opening a notebook should fire activeNotebook event changed only once', async function () {
const openedEditor = onDidOpenNotebookEditor();