fix(ai-toolbar): gate paste capture on AI availability

This commit is contained in:
old4ever committed 2026-04-22 17:54:49 -04:00
1 parent e817fb52cf
commit bfb29d3986
2 files changed
+17 -4

No files matched your search

+13
View File
@@ -323,6 +323,19 @@ describe("Keyboard shortcuts – toolbar integration contract", () => {
});
});
describe("Global paste capture – AI availability gate", () => {
test("document-level paste handlers only arm when AI is actually usable", () => {
const source = readToolbarSource();
expect(source).toContain(
"if (!isAuthenticated || isPending || !canUseAi || aiLoading) return;",
);
expect(source).toContain(
"}, [isAuthenticated, isPending, canUseAi, aiLoading]);",
);
});
});
// ─── Cycle 8: Multi-image thumbnail strip ────────────────────────────────────
//
// When multiple images are attached, they render as a horizontal scrollable