mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-19 16:18:58 +01:00
Ensure runState is updated correctly
This commit is contained in:
@@ -1546,6 +1546,32 @@ suite('Notebook API tests', function () {
|
||||
await saveAllFilesAndCloseAll(resource);
|
||||
});
|
||||
|
||||
test('Numeric metadata should get updated correctly', async function () {
|
||||
const resource = await createRandomFile('', undefined, '.vsctestnb');
|
||||
const document = await vscode.notebook.openNotebookDocument(resource);
|
||||
|
||||
const edit = new vscode.WorkspaceEdit();
|
||||
const runStartTime = Date.now();
|
||||
const lastRunDuration = Date.now() + 1000;
|
||||
const runState = vscode.NotebookCellRunState.Running;
|
||||
const executionOrder = 1234;
|
||||
const metadata = document.cells[0].metadata.with({
|
||||
...document.cells[0].metadata,
|
||||
runStartTime,
|
||||
runState,
|
||||
lastRunDuration,
|
||||
executionOrder
|
||||
});
|
||||
edit.replaceNotebookCellMetadata(document.uri, 0, metadata);
|
||||
await vscode.workspace.applyEdit(edit);
|
||||
|
||||
assert.strictEqual(document.cells[0].metadata.runStartTime, runStartTime);
|
||||
assert.strictEqual(document.cells[0].metadata.lastRunDuration, lastRunDuration);
|
||||
assert.strictEqual(document.cells[0].metadata.executionOrder, executionOrder);
|
||||
assert.strictEqual(document.cells[0].metadata.runState, vscode.NotebookCellRunState.Running);
|
||||
await saveAllFilesAndCloseAll(resource);
|
||||
});
|
||||
|
||||
// });
|
||||
|
||||
// suite('webview', () => {
|
||||
|
||||
Reference in New Issue
Block a user