smoke - add test to verify an editor can be saved

This commit is contained in:
Benjamin Pasero 2021-12-10 13:45:08 +01:00
parent 4667cac14b
commit 05de5834b0
No known key found for this signature in database
GPG key ID: E6380CC4C8219E65

View file

@ -38,6 +38,39 @@ export function setup(ensureStableCode: () => string | undefined, logger: Logger
app = undefined;
});
it('verifies editors can save and restore', async function () {
app = await startApp(this.defaultOptions);
const readmeMd = 'readme.md';
const appJs = 'app.js';
const textToType = 'Hello, Code';
// open first editor
await app.workbench.quickaccess.openFile(readmeMd);
await app.workbench.quickaccess.runCommand('View: Keep Editor');
// open second editor and type
await app.workbench.quickaccess.openFile('app.js');
await app.workbench.editor.waitForTypeInEditor(appJs, textToType);
await app.workbench.editors.waitForTab(appJs, true);
// save
await app.workbench.editors.saveOpenedFile();
await app.workbench.editors.waitForTab(appJs, false);
// close editor
const waitForEditorClosed = app.workbench.editors.waitForActiveEditor(readmeMd);
await app.workbench.quickaccess.runCommand('workbench.action.closeActiveEditor');
await waitForEditorClosed;
// open editor again and verify contents
await app.workbench.quickaccess.openFile(appJs);
await app.workbench.editor.waitForEditorContents(appJs, contents => contents.indexOf(textToType) > -1);
await app.stop();
app = undefined;
});
it('verifies that "hot exit" works for dirty files (without delay)', function () {
return testHotExit.call(this, undefined);
});