Files
oh-my-pi/packages/coding-agent/test/modes/controllers/command-controller-hotkeys.test.ts
T
daandden b7978c9e0d feat: add undo action and fix hotkeys rendering (#438)
* Fix prompt action undo and hotkeys rendering

* Fix prompt action test typechecks

* Simplify undo and hotkeys PR

* Fix editor formatting
2026-03-16 14:05:21 +01:00

26 lines
922 B
TypeScript

import { describe, expect, it } from "bun:test";
import { buildHotkeysMarkdown } from "../../../src/modes/utils/hotkeys-markdown";
describe("buildHotkeysMarkdown", () => {
it("emits flush-left markdown so headings and tables are parsed instead of treated as indented text", () => {
const markdown = buildHotkeysMarkdown({
expandToolsKey: "Ctrl+O",
planModeKey: "Alt+M",
sttKey: "Alt+H",
copyLineKey: "Alt+Shift+L",
copyPromptKey: "Ctrl+Shift+P",
});
const lines = markdown.split("\n");
expect(lines[0]).toBe("**Navigation**");
expect(markdown).toContain("| `Ctrl+Shift+P` | Copy whole prompt |");
expect(markdown).toContain("| `Alt+M` | Toggle plan mode |");
expect(markdown).toContain("| `#` | Open prompt actions |");
for (const line of lines) {
if (line.length === 0) continue;
expect(line.startsWith(" ")).toBe(false);
expect(line.startsWith("\t")).toBe(false);
}
});
});