Skip to content
Source
Sign inSign up

projectIconOptions.test.ts

22 lines1.1 KB

1import { AlarmClockCheck, ArrowDown01, Layers3 } from "lucide-react";
2import { describe, expect, it } from "vite-plus/test";
3import { lucideIconByName } from "./lib/lucideIconByName";
4import { filterProjectIconNames, firstEmoji } from "./projectIconOptions";
5​
6describe("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});