Skip to content

Commit 1873a45

Browse files
committed
Add line numbers test
Fixes #141054
1 parent 47d529f commit 1873a45

File tree

2 files changed

+20
-5
lines changed

2 files changed

+20
-5
lines changed

test/automation/src/settings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class SettingsEditor {
5656

5757
async openUserSettingsUI(): Promise<void> {
5858
await this.quickaccess.runCommand('workbench.action.openSettings2');
59-
await this.code.waitForElement('.settings-group-title-label');
59+
await this.code.waitForElement('.settings-editor');
6060
}
6161

6262
async searchSettingsUI(query: string): Promise<void> {

test/smoke/src/areas/preferences/preferences.test.ts

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ export function setup(logger: Logger) {
1616
const app = this.app as Application;
1717

1818
await app.workbench.settingsEditor.openUserSettingsFile();
19-
await app.code.waitForElements('.line-numbers', false, elements => !!elements.length);
19+
await app.code.waitForElements('.margin .line-numbers', false, elements => !!elements.length);
2020

2121
await app.workbench.settingsEditor.addUserSetting('editor.lineNumbers', '"off"');
22-
await app.code.waitForElements('.line-numbers', false, result => !result || result.length === 0);
22+
await app.code.waitForElements('.margin .line-numbers', false, elements => !elements || elements.length === 0);
2323
});
2424

2525
it('changes "workbench.action.toggleSidebarPosition" command key binding and verifies it', async function () {
@@ -43,9 +43,24 @@ export function setup(logger: Logger) {
4343
const app = this.app as Application;
4444

4545
await app.workbench.settingsEditor.searchSettingsUI('@id:editor.tabSize');
46-
await app.code.waitForSetValue('.settings-editor .setting-item-contents .setting-item-control input', '15');
46+
await app.code.waitForSetValue('.settings-editor .setting-item-contents .setting-item-control input', '6');
4747
await app.code.waitForElement('.settings-editor .setting-item-contents .setting-item-modified-indicator');
48-
await app.code.waitForSetValue('.settings-editor .setting-item-contents .setting-item-control input', '14');
48+
await app.code.waitForSetValue('.settings-editor .setting-item-contents .setting-item-control input', '4');
49+
});
50+
51+
it('turns off editor line numbers and verifies the live change', async function () {
52+
const app = this.app as Application;
53+
54+
await app.workbench.editors.newUntitledFile();
55+
await app.code.dispatchKeybinding('enter');
56+
await app.code.waitForElements('.margin .line-numbers', false, elements => !!elements.length);
57+
58+
await app.workbench.settingsEditor.searchSettingsUI('editor.lineNumbers');
59+
await app.code.waitAndClick('.settings-editor .monaco-list-rows .setting-item-control select', 2, 2);
60+
await app.code.waitAndClick('.context-view .option-text', 2, 2);
61+
62+
await app.workbench.editors.selectTab('Untitled-1');
63+
await app.code.waitForElements('.margin .line-numbers', false, elements => !elements || elements.length === 0);
4964
});
5065
});
5166
}

0 commit comments

Comments
 (0)