This commit is contained in:
rebornix
2020-09-09 16:06:28 -07:00
parent 7e62739639
commit 73a3c9ded3
5 changed files with 29 additions and 25 deletions

View File

@@ -690,11 +690,18 @@ suite('notebook workflow', () => {
await vscode.commands.executeCommand('notebook.focusTop');
const cell = editor.document.cells[0];
assert.equal(cell.outputs.length, 0);
let metadataChangeEvent = getEventOncePromise<vscode.NotebookCellMetadataChangeEvent>(vscode.notebook.onDidChangeCellMetadata);
cell.metadata.runnable = false;
await metadataChangeEvent;
await vscode.commands.executeCommand('notebook.cell.execute');
assert.equal(cell.outputs.length, 0, 'should not execute'); // not runnable, didn't work
metadataChangeEvent = getEventOncePromise<vscode.NotebookCellMetadataChangeEvent>(vscode.notebook.onDidChangeCellMetadata);
cell.metadata.runnable = true;
await metadataChangeEvent;
await vscode.commands.executeCommand('notebook.cell.execute');
assert.equal(cell.outputs.length, 1, 'should execute'); // runnable, it worked