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({ "app.message.dequeue": "alt+up", }); expect(keybindings.getDisplayString("app.message.dequeue")).toBe("Alt+Up"); }); it("formats multiple bindings with the existing separator", () => { const keybindings = KeybindingsManager.inMemory({ "app.clipboard.copyPrompt": ["alt+shift+c", "ctrl+shift+c"], }); expect(keybindings.getDisplayString("app.clipboard.copyPrompt")).toBe("Alt+Shift+C/Ctrl+Shift+C"); }); it("returns an empty string when the action has no binding", () => { const keybindings = KeybindingsManager.inMemory({ "app.clipboard.copyPrompt": [], }); expect(keybindings.getDisplayString("app.clipboard.copyPrompt")).toBe(""); }); });