Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/test/smoke/src/areas/terminal/terminal-splitCwd.test.ts
3520 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { Application, Terminal, SettingsEditor } from '../../../../automation';
7
import { setTerminalTestSettings } from './terminal-helpers';
8
9
export function setup(options?: { skipSuite: boolean }) {
10
(options?.skipSuite ? describe.skip : describe)('Terminal splitCwd', () => {
11
// Acquire automation API
12
let terminal: Terminal;
13
let settingsEditor: SettingsEditor;
14
before(async function () {
15
const app = this.app as Application;
16
terminal = app.workbench.terminal;
17
settingsEditor = app.workbench.settingsEditor;
18
await setTerminalTestSettings(app, [
19
['terminal.integrated.splitCwd', '"inherited"']
20
]);
21
});
22
23
after(async function () {
24
await settingsEditor.clearUserSettings();
25
});
26
27
it('should inherit cwd when split and update the tab description - alt click', async () => {
28
await terminal.createTerminal();
29
const cwd = 'test';
30
await terminal.runCommandInTerminal(`mkdir ${cwd}`);
31
await terminal.runCommandInTerminal(`cd ${cwd}`);
32
const page = await terminal.getPage();
33
page.keyboard.down('Alt');
34
await terminal.clickSingleTab();
35
page.keyboard.up('Alt');
36
await terminal.assertTerminalGroups([[{ description: cwd }, { description: cwd }]]);
37
});
38
});
39
}
40
41