Skip to content

Commit b443ef5

Browse files
sahrizviclaude
andcommitted
test(tui): the adapter-gate case must use a chord the dialog receives
ctrl+p is the palette outside a dialog and never reached the action, so the previous no-row assertion was vacuous. ctrl+o instead, with a positive control that the action fires with a row; disabling the adapter gate now fails the test. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_012Q51zFUmPg1WwtS5CrGJE6
1 parent e705c90 commit b443ef5

1 file changed

Lines changed: 13 additions & 2 deletions

File tree

‎packages/tui/test/ui/dialog-select-actions.test.tsx‎

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ async function mount(
6767
{ key: "ctrl+a", cmd: "altimate.skill.list.actions" },
6868
{ key: "ctrl+e", cmd: "altimate.skill.list.create" },
6969
{ key: "ctrl+g", cmd: "altimate.skill.list.install" },
70-
{ key: "ctrl+p", cmd: "altimate.skill.list.plain" },
70+
{ key: "ctrl+o", cmd: "altimate.skill.list.plain" },
7171
]
7272
const options = [
7373
{ title: "alpha", value: "alpha" },
@@ -266,7 +266,7 @@ test("through the plugin API adapter: chords fire, standalone survives the mappi
266266
expect(triggered).toEqual(["actions:alpha"])
267267
for (const ch of "zzz") app.mockInput.pressKey(ch)
268268
await Bun.sleep(50)
269-
app.mockInput.pressKey("p", { ctrl: true }) // row-bound, no `disabled`: the adapter gate alone stops it (ctrl+p is only the palette outside a dialog)
269+
app.mockInput.pressKey("o", { ctrl: true }) // row-bound, no `disabled`: the adapter gate alone stops it
270270
await Bun.sleep(100)
271271
expect(triggered).toEqual(["actions:alpha"])
272272
app.mockInput.pressKey("g", { ctrl: true })
@@ -276,3 +276,14 @@ test("through the plugin API adapter: chords fire, standalone survives the mappi
276276
app.renderer.destroy()
277277
}
278278
})
279+
280+
test("the plain row-bound action does fire with a row (so the no-row assertion above is not vacuous)", async () => {
281+
const { app, triggered } = await mount({ via: "adapter" })
282+
try {
283+
app.mockInput.pressKey("o", { ctrl: true })
284+
await wait(() => triggered.length > 0)
285+
expect(triggered).toEqual(["plain:alpha"])
286+
} finally {
287+
app.renderer.destroy()
288+
}
289+
})

0 commit comments

Comments
 (0)