Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

projectIconOptions.test.ts

24 lines887 Bytes

1import { describe, expect, it } from "vite-plus/test";
2import {
3 filterProjectIconNames,
4 firstEmoji,
5 projectIconColorClassName,
6} from "./projectIconOptions";
7​
8describe("projectIconOptions", () => {
9 it("searches across the full Lucide set", () => {
10 expect(filterProjectIconNames("alarm clock")).toContain("alarm-clock");
11 expect(filterProjectIconNames("alarm \tclock")).toContain("alarm-clock");
12 });
13​
14 it("extracts one complete emoji grapheme", () => {
15 expect(firstEmoji(" πŸ‘©πŸ½β€πŸ’» hello")).toBe("πŸ‘©πŸ½β€πŸ’»");
16 expect(firstEmoji("πŸ‡ΊπŸ‡Έ project")).toBe("πŸ‡ΊπŸ‡Έ");
17 expect(firstEmoji("1️⃣ project")).toBe("1️⃣");
18 expect(firstEmoji("plain text")).toBeNull();
19 });
20​
21 it("maps persisted colors to theme-aware classes", () => {
22 expect(projectIconColorClassName("violet")).toBe("text-violet-600 dark:text-violet-400");
23 });
24});