mirror of
https://github.com/Microsoft/vscode
synced 2024-10-02 09:18:59 +00:00
allow time to scroll (#204646)
This commit is contained in:
parent
533da38207
commit
fe6db4073f
|
@ -99,8 +99,13 @@ async function addCellAndRun(code: string, notebook: vscode.NotebookDocument) {
|
|||
}
|
||||
|
||||
// Verify visible range has the last cell
|
||||
assert.strictEqual(notebookEditor.visibleRanges[notebookEditor.visibleRanges.length - 1].end, notebookEditor.notebook.cellCount, `Last cell is not visible`);
|
||||
|
||||
if (!lastCellIsVisible(notebookEditor)) {
|
||||
// scroll happens async, so give it some time to scroll
|
||||
await new Promise<void>((resolve) => setTimeout(() => {
|
||||
assert.ok(lastCellIsVisible(notebookEditor), `Last cell is not visible`);
|
||||
resolve();
|
||||
}, 1000));
|
||||
}
|
||||
});
|
||||
|
||||
test('Interactive window has the correct kernel', async () => {
|
||||
|
@ -120,3 +125,8 @@ async function addCellAndRun(code: string, notebook: vscode.NotebookDocument) {
|
|||
|
||||
});
|
||||
});
|
||||
|
||||
function lastCellIsVisible(notebookEditor: vscode.NotebookEditor) {
|
||||
const lastVisibleCell = notebookEditor.visibleRanges[notebookEditor.visibleRanges.length - 1].end;
|
||||
return notebookEditor.notebook.cellCount === lastVisibleCell;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue