test(app): use platform-aware editor chords in file-editing e2e
CodeMirror's mac keymap binds doc start/end to Cmd and gives Ctrl-a the emacs line-start behaviour, so the Control chords in these specs did nothing on macOS and only passed on Linux CI.
This commit is contained in:
@@ -117,7 +117,7 @@ test.describe("CodeMirror workspace file editing", () => {
|
|||||||
|
|
||||||
const sourceEditor = editor(page);
|
const sourceEditor = editor(page);
|
||||||
await sourceEditor.click();
|
await sourceEditor.click();
|
||||||
await sourceEditor.press("Control+Home");
|
await sourceEditor.press("ControlOrMeta+Home");
|
||||||
await expect(page.getByLabel(/^Line 1, column \d+$/)).toBeVisible();
|
await expect(page.getByLabel(/^Line 1, column \d+$/)).toBeVisible();
|
||||||
|
|
||||||
await page
|
await page
|
||||||
@@ -241,13 +241,13 @@ test.describe("CodeMirror workspace file editing", () => {
|
|||||||
const initialModeBox = await modeControl.boundingBox();
|
const initialModeBox = await modeControl.boundingBox();
|
||||||
expect(initialModeBox).not.toBeNull();
|
expect(initialModeBox).not.toBeNull();
|
||||||
const initialModeX = initialModeBox!.x;
|
const initialModeX = initialModeBox!.x;
|
||||||
await content.press("Control+End");
|
await content.press("ControlOrMeta+End");
|
||||||
await expect(page.getByLabel(/Line 12, column \d+/)).toBeVisible();
|
await expect(page.getByLabel(/Line 12, column \d+/)).toBeVisible();
|
||||||
const movedModeBox = await modeControl.boundingBox();
|
const movedModeBox = await modeControl.boundingBox();
|
||||||
expect(movedModeBox).not.toBeNull();
|
expect(movedModeBox).not.toBeNull();
|
||||||
expect(movedModeBox!.x).toBe(initialModeX);
|
expect(movedModeBox!.x).toBe(initialModeX);
|
||||||
|
|
||||||
await content.press("Control+a");
|
await content.press("ControlOrMeta+a");
|
||||||
const selection = editorHost.locator(".cm-selectionBackground").first();
|
const selection = editorHost.locator(".cm-selectionBackground").first();
|
||||||
await expect(selection).toBeVisible();
|
await expect(selection).toBeVisible();
|
||||||
await expect(selection).toHaveCSS("background-color", "rgba(255, 255, 255, 0.2)");
|
await expect(selection).toHaveCSS("background-color", "rgba(255, 255, 255, 0.2)");
|
||||||
|
|||||||
Reference in New Issue
Block a user