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:
Mohamed Boudra
2026-08-21 15:20:15 +02:00
parent 2caecdaae8
commit 75b0eaf8a8
@@ -117,7 +117,7 @@ test.describe("CodeMirror workspace file editing", () => {
const sourceEditor = editor(page);
await sourceEditor.click();
await sourceEditor.press("Control+Home");
await sourceEditor.press("ControlOrMeta+Home");
await expect(page.getByLabel(/^Line 1, column \d+$/)).toBeVisible();
await page
@@ -241,13 +241,13 @@ test.describe("CodeMirror workspace file editing", () => {
const initialModeBox = await modeControl.boundingBox();
expect(initialModeBox).not.toBeNull();
const initialModeX = initialModeBox!.x;
await content.press("Control+End");
await content.press("ControlOrMeta+End");
await expect(page.getByLabel(/Line 12, column \d+/)).toBeVisible();
const movedModeBox = await modeControl.boundingBox();
expect(movedModeBox).not.toBeNull();
expect(movedModeBox!.x).toBe(initialModeX);
await content.press("Control+a");
await content.press("ControlOrMeta+a");
const selection = editorHost.locator(".cm-selectionBackground").first();
await expect(selection).toBeVisible();
await expect(selection).toHaveCSS("background-color", "rgba(255, 255, 255, 0.2)");