refine test for https://github.com/microsoft/vscode/issues/106657 and document issue with fragments and the editor opener

This commit is contained in:
Johannes Rieken
2020-09-14 16:57:24 +02:00
parent 98ee37629d
commit f096f59404

View File

@@ -1240,10 +1240,29 @@ suite('regression', () => {
assert.strictEqual(vscode.notebook.activeNotebookEditor, undefined);
// opening a cell-uri opens a notebook editor
await vscode.commands.executeCommand('vscode.open', cell.uri);
await vscode.commands.executeCommand('vscode.open', cell.uri, vscode.ViewColumn.Active);
assert.strictEqual(!!vscode.notebook.activeNotebookEditor, true);
// assert.strictEqual(vscode.notebook.activeNotebookEditor?.document.uri.toString(), resource.toString());
assert.strictEqual(vscode.notebook.activeNotebookEditor?.document.uri.toString(), resource.toString());
});
test('Cannot open notebook from cell-uri with vscode.open-command', async function () {
this.skip();
assertInitalState();
const resource = await createRandomFile('', undefined, 'first', '.vsctestnb');
await vscode.commands.executeCommand('vscode.openWith', resource, 'notebookCoreTest');
const document = vscode.notebook.activeNotebookEditor?.document!;
const [cell] = document.cells;
await saveAllFilesAndCloseAll(document.uri);
assert.strictEqual(vscode.notebook.activeNotebookEditor, undefined);
// BUG is that the editor opener (https://github.com/microsoft/vscode/blob/8e7877bdc442f1e83a7fec51920d82b696139129/src/vs/editor/browser/services/openerService.ts#L69)
// removes the fragment if it matches something numeric. For notebooks that's not wanted...
await vscode.commands.executeCommand('vscode.open', cell.uri);
assert.strictEqual(vscode.notebook.activeNotebookEditor?.document.uri.toString(), resource.toString());
});
test('#97830, #97764. Support switch to other editor types', async function () {