mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 13:46:13 +00:00
Re microsoft/vscode-github-issue-notebooks#26. test for regression.
This commit is contained in:
parent
a89fc0912f
commit
f027dd6fae
|
@ -320,3 +320,15 @@ suite('notebook working copy', () => {
|
|||
await vscode.commands.executeCommand('workbench.action.closeActiveEditor');
|
||||
});
|
||||
});
|
||||
|
||||
suite('regression', () => {
|
||||
test('microsoft/vscode-github-issue-notebooks#26. Insert template cell in the new empty document', async function () {
|
||||
const resource = vscode.Uri.parse(join(vscode.workspace.rootPath || '', './empty.vsctestnb'));
|
||||
await vscode.commands.executeCommand('vscode.openWith', resource, 'notebookCoreTest');
|
||||
|
||||
await waitFor(500);
|
||||
assert.equal(vscode.notebook.activeNotebookEditor !== undefined, true, 'notebook first');
|
||||
assert.equal(vscode.notebook.activeNotebookEditor!.selection?.source, '');
|
||||
assert.equal(vscode.notebook.activeNotebookEditor!.selection?.language, 'typescript');
|
||||
});
|
||||
});
|
||||
|
|
|
@ -9,6 +9,14 @@ export function activate(context: vscode.ExtensionContext): any {
|
|||
context.subscriptions.push(vscode.notebook.registerNotebookContentProvider('notebookCoreTest', {
|
||||
onDidChangeNotebook: new vscode.EventEmitter<vscode.NotebookDocumentEditEvent>().event,
|
||||
openNotebook: async (_resource: vscode.Uri) => {
|
||||
if (_resource.path.endsWith('empty.vsctestnb')) {
|
||||
return {
|
||||
languages: ['typescript'],
|
||||
metadata: {},
|
||||
cells: []
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
languages: ['typescript'],
|
||||
metadata: {},
|
||||
|
|
4
extensions/vscode-notebook-tests/test/empty.vsctestnb
Normal file
4
extensions/vscode-notebook-tests/test/empty.vsctestnb
Normal file
|
@ -0,0 +1,4 @@
|
|||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
Loading…
Reference in a new issue