asWebUri.

This commit is contained in:
rebornix
2020-05-14 17:52:14 -07:00
parent 48539eea8b
commit b9c163faee
17 changed files with 222 additions and 137 deletions

View File

@@ -345,3 +345,15 @@ suite('regression', () => {
assert.equal(vscode.notebook.activeNotebookEditor!.selection?.language, 'typescript');
});
});
suite('webview resource uri', () => {
test('asWebviewUri', async function () {
const resource = vscode.Uri.parse(join(vscode.workspace.rootPath || '', './first.vsctestnb'));
await vscode.commands.executeCommand('vscode.openWith', resource, 'notebookCoreTest');
await waitFor(500);
assert.equal(vscode.notebook.activeNotebookEditor !== undefined, true, 'notebook first');
const uri = vscode.notebook.activeNotebookEditor!.asWebviewUri(vscode.Uri.parse('./hello.png'));
assert.equal(uri.scheme, 'vscode-resource');
});
});