diff --git a/tests/ai-toolbar-state.test.ts b/tests/ai-toolbar-state.test.ts index 2447d03..8fddc25 100644 --- a/tests/ai-toolbar-state.test.ts +++ b/tests/ai-toolbar-state.test.ts @@ -100,6 +100,18 @@ describe("AI toolbar state rendering", () => { ); }); + test("Generate event button calls onAiCreate when the composer is actionable", async () => { + const onAiCreate = mock(); + const actions = await renderToolbarActionBoundary({ + aiPrompt: "Draft a kickoff", + onAiCreate, + }); + + actions.getButtonByLabel("Generate event").onClick?.({} as never); + + expect(onAiCreate).toHaveBeenCalledTimes(1); + }); + test("AI unavailable state removes the composer so generate shortcuts are not exposed", async () => { const markup = await renderToolbarMarkup({ aiEnabled: false });