refactor: better typing for tool icons

This commit is contained in:
2026-10-10 11:47:31 +05:00
parent 8b2172c39a
commit 2ddb348e54
20 changed files with 94 additions and 62 deletions
+18
View File
@@ -0,0 +1,18 @@
import { describe, expect, it } from "vitest";
import { PAGES } from "./registry";
import { TOOL_ICONS } from "./tool-icons";
describe("tool-icons", () => {
it("every icon key is an existing page slug", () => {
const slugs = new Set<string>(PAGES.map((page) => page.slug));
const orphans = Object.keys(TOOL_ICONS).filter((key) => !slugs.has(key));
expect(orphans).toEqual([]);
});
it("every page has an icon", () => {
const missing = PAGES.map((page) => page.slug).filter(
(slug) => !(slug in TOOL_ICONS),
);
expect(missing).toEqual([]);
});
});