test(ai-toolbar): cover primary generate action

This commit is contained in:
2026-04-23 10:30:17 -04:00
parent 2590e1dbaf
commit 251520fd29

View File

@@ -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 });