import { describe, expect, it } from "vitest"; import { actionBadgeStyle, avatarColorFor, STATUS_STYLES } from "@/lib/colors"; describe("avatarColorFor", () => { it("is deterministic for the same seed", () => { expect(avatarColorFor("Maria Gruber")).toBe(avatarColorFor("Maria Gruber")); }); it("returns a value from the fixed palette (a hex color)", () => { expect(avatarColorFor("Anna Huber")).toMatch(/^#[0-9a-f]{6}$/i); }); }); describe("STATUS_STYLES", () => { it("has an entry for every employment status", () => { expect(Object.keys(STATUS_STYLES).sort()).toEqual(["Aktiv", "Ausgetreten", "Geplant", "Karenz"].sort()); }); }); describe("actionBadgeStyle", () => { it("maps known audit actions to their category style", () => { expect(actionBadgeStyle("Austritt")).toBe(STATUS_STYLES.Ausgetreten); expect(actionBadgeStyle("Neueinstellung")).toBe(STATUS_STYLES.Aktiv); }); it("falls back to the brand style for an unknown action", () => { expect(actionBadgeStyle("Irgendwas Unbekanntes")).toContain("bg-brand-100"); }); });