import { trendColorClass } from "../stat-card"; describe("trendColorClass", () => { it("colours an upward trend with the success token", () => { expect(trendColorClass("up")).toContain("text-success"); }); it("colours a downward trend with the destructive token", () => { expect(trendColorClass("down")).toContain("text-destructive"); }); it("falls back to muted for a neutral trend", () => { expect(trendColorClass("neutral")).toContain("text-muted-foreground"); }); it("uses only palette tokens, never raw hex", () => { for (const trend of ["up", "down", "neutral"] as const) { expect(trendColorClass(trend)).not.toMatch(/#[0-9a-fA-F]{3,8}/); } }); });