Files
oh-my-pi/packages/coding-agent/test/keybindings-display.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

29 lines
881 B
TypeScript

import { describe, expect, it } from "bun:test";
import { KeybindingsManager } from "../src/config/keybindings";
describe("KeybindingsManager.getDisplayString", () => {
it("formats a single binding as a human-readable key hint", () => {
const keybindings = KeybindingsManager.inMemory({
dequeue: "alt+up",
});
expect(keybindings.getDisplayString("dequeue")).toBe("Alt+Up");
});
it("formats multiple bindings with the existing separator", () => {
const keybindings = KeybindingsManager.inMemory({
copyPrompt: ["alt+shift+c", "ctrl+shift+c"],
});
expect(keybindings.getDisplayString("copyPrompt")).toBe("Alt+Shift+C/Ctrl+Shift+C");
});
it("returns an empty string when the action has no binding", () => {
const keybindings = KeybindingsManager.inMemory({
copyPrompt: [],
});
expect(keybindings.getDisplayString("copyPrompt")).toBe("");
});
});