test(ai-toolbar): cover primary generate action
This commit is contained in:
@@ -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 });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user