Files
t3code/apps/web/src/projectIconOptions.test.ts
T
2026-09-03 01:17:38 -04:00

25 lines
887 B
TypeScript

import { describe, expect, it } from "vite-plus/test";
import {
filterProjectIconNames,
firstEmoji,
projectIconColorClassName,
} from "./projectIconOptions";
describe("projectIconOptions", () => {
it("searches across the full Lucide set", () => {
expect(filterProjectIconNames("alarm clock")).toContain("alarm-clock");
expect(filterProjectIconNames("alarm \tclock")).toContain("alarm-clock");
});
it("extracts one complete emoji grapheme", () => {
expect(firstEmoji(" 👩🏽‍💻 hello")).toBe("👩🏽‍💻");
expect(firstEmoji("🇺🇸 project")).toBe("🇺🇸");
expect(firstEmoji("1️⃣ project")).toBe("1️⃣");
expect(firstEmoji("plain text")).toBeNull();
});
it("maps persisted colors to theme-aware classes", () => {
expect(projectIconColorClassName("violet")).toBe("text-violet-600 dark:text-violet-400");
});
});