diff --git a/e2e/external-edit.test.ts b/e2e/external-edit.test.ts index d12e9090..824d662b 100644 --- a/e2e/external-edit.test.ts +++ b/e2e/external-edit.test.ts @@ -5,6 +5,7 @@ import { join } from "node:path"; import { gotoSilverBulletPage, mod, + redoChord, spawnServerProcess, test, waitForServer, @@ -120,7 +121,7 @@ test("undo after moving the cursor past an external edit restores the user's cur selection: { anchor: 3 }, }); }); - await sbPage.keyboard.press(`${mod}+Shift+z`); + await sbPage.keyboard.press(redoChord); await expect(editor).toContainText("External line"); const afterRedo = await sbPage.evaluate( () => (globalThis as any).client.editorView.state.selection.main.head, diff --git a/e2e/fixtures.ts b/e2e/fixtures.ts index c1f543ec..6314ff39 100644 --- a/e2e/fixtures.ts +++ b/e2e/fixtures.ts @@ -8,6 +8,15 @@ import { test as base, type Page } from "@playwright/test"; /** The platform-appropriate modifier key: Meta on macOS, Control elsewhere. */ export const mod = platform() === "darwin" ? "Meta" : "Control"; +/** + * Full redo chord, per the "Editor: Redo" binding in editor_commands.ts: + * Cmd-Shift-z on macOS, Ctrl-y elsewhere. `${mod}+Shift+z` is NOT a redo + * anywhere but macOS -- it silently does nothing on Linux. + */ +export const redoChord = platform() === "darwin" + ? "Meta+Shift+z" + : "Control+y"; + /** The admin account every multi-space e2e test provisions via `silverbullet setup`. */ export const ADMIN_USER = "admin"; export const ADMIN_PASSWORD = "adminpw123";