The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import { AlarmClockCheck, ArrowDown01, Layers3 } from "lucide-react"; |
| 2 | import { describe, expect, it } from "vite-plus/test"; |
| 3 | import { lucideIconByName } from "./lib/lucideIconByName"; |
| 4 | import { filterProjectIconNames, firstEmoji, isValidProjectMonogram } from "./projectIconOptions"; |
| 5 | |
| 6 | describe("projectIconOptions", () => { |
| 7 | it("resolves every offered icon name, including saved legacy spellings", () => { |
| 8 | for (const name of filterProjectIconNames("")) expect(lucideIconByName(name)).toBeDefined(); |
| 9 | expect(lucideIconByName("layers-3")).toBe(Layers3); |
| 10 | expect(lucideIconByName("arrow-down-01")).toBe(ArrowDown01); |
| 11 | expect(lucideIconByName("arrow-down-0-1")).toBe(ArrowDown01); |
| 12 | expect(lucideIconByName("alarm-check")).toBe(AlarmClockCheck); |
| 13 | expect(lucideIconByName("create-lucide-icon")).toBeUndefined(); |
| 14 | }); |
| 15 | |
| 16 | it("extracts one complete emoji grapheme", () => { |
| 17 | expect(firstEmoji(" 👩🏽💻 hello")).toBe("👩🏽💻"); |
| 18 | expect(firstEmoji("🇺🇸 project")).toBe("🇺🇸"); |
| 19 | expect(firstEmoji("1️⃣ project")).toBe("1️⃣"); |
| 20 | expect(firstEmoji("plain text")).toBeNull(); |
| 21 | }); |
| 22 | |
| 23 | it("allows monograms of at most two characters", () => { |
| 24 | for (const [text, valid] of [ |
| 25 | ["T", true], |
| 26 | ["T3", true], |
| 27 | ["E\u0301E\u0301", true], |
| 28 | ["ABC", false], |
| 29 | ] as const) { |
| 30 | expect(isValidProjectMonogram(text), text).toBe(valid); |
| 31 | } |
| 32 | }); |
| 33 | }); |