The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import { describe, expect, it } from "vite-plus/test"; |
| 2 | |
| 3 | import { parseDesktopSnapShotShortcut, snapShotShortcutKeyLabels } from "./snapShotShortcut"; |
| 4 | |
| 5 | describe("desktop-approved window capture shortcut labels", () => { |
| 6 | it.each([ |
| 7 | ["Press <Shift><Control>2", ["Ctrl", "⇧", "2"]], |
| 8 | ["Ctrl+Shift+8", ["Ctrl", "⇧", "8"]], |
| 9 | ["Meta+F12", ["Super", "F12"]], |
| 10 | ["<Primary><Alt>Return", ["Ctrl", "Alt", "Enter"]], |
| 11 | ["<Super>Left", ["Super", "Left"]], |
| 12 | ["<Control>space", ["Ctrl", "Space"]], |
| 13 | ["<Control>plus", ["Ctrl", "+"]], |
| 14 | ["Ctrl++", ["Ctrl", "+"]], |
| 15 | ["<Control>Page_Up", ["Ctrl", "PageUp"]], |
| 16 | ["<Shift>Page_Down", ["⇧", "PageDown"]], |
| 17 | ])("formats %s using the shared keycap labels", (label, expected) => { |
| 18 | const shortcut = parseDesktopSnapShotShortcut(label); |
| 19 | expect(shortcut).not.toBeNull(); |
| 20 | expect(snapShotShortcutKeyLabels(shortcut!, "Linux")).toEqual(expected); |
| 21 | }); |
| 22 | |
| 23 | it.each([ |
| 24 | "", |
| 25 | "Ctrl+", |
| 26 | "Press the shortcut configured in your desktop", |
| 27 | "<Unknown>2", |
| 28 | "<Control>UnknownKey", |
| 29 | ])("does not guess keys from an unrecognized description: %s", (label) => { |
| 30 | expect(parseDesktopSnapShotShortcut(label)).toBeNull(); |
| 31 | }); |
| 32 | }); |