feat: add AI settings controls
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { describe, expect, test } from "bun:test";
|
||||
import { getAiDisabledMessage } from "@/lib/ai-feature-flags";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
@@ -35,6 +36,9 @@ const LOCKED_AI_CTA_CLASSES =
|
||||
const LOCKED_AI_TEXT_CLASSES =
|
||||
"text-sm font-medium text-foreground";
|
||||
|
||||
const DISABLED_AI_TEXT_CLASSES =
|
||||
"text-sm leading-relaxed text-muted-foreground";
|
||||
|
||||
/** Data zone: neutral surface, clearly secondary to AI zone */
|
||||
const DATA_ZONE_CLASSES =
|
||||
"flex items-center gap-2 flex-wrap";
|
||||
@@ -86,6 +90,23 @@ describe("AI zone – locked state CTA (unauthenticated)", () => {
|
||||
const resolved = cn(LOCKED_AI_TEXT_CLASSES);
|
||||
expect(resolved).toContain("font-medium");
|
||||
});
|
||||
|
||||
test("locked CTA copy clearly requires signing in", () => {
|
||||
const copy = "Sign in required to generate event drafts with AI";
|
||||
expect(copy.toLowerCase()).toContain("sign in");
|
||||
expect(copy.toLowerCase()).toContain("required");
|
||||
});
|
||||
});
|
||||
|
||||
describe("AI zone – disabled state", () => {
|
||||
test("disabled AI body text stays muted because it is informative, not a CTA", () => {
|
||||
const resolved = cn(DISABLED_AI_TEXT_CLASSES);
|
||||
expect(resolved).toContain("text-muted-foreground");
|
||||
});
|
||||
|
||||
test("admin-disabled copy explains the unavailable state", () => {
|
||||
expect(getAiDisabledMessage().toLowerCase()).toContain("disabled");
|
||||
});
|
||||
});
|
||||
|
||||
// ─── Cycle 2: Data zone action buttons ──────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user