mirror of
https://github.com/Ku6epXBOCTuK/easy-png-tools.git
synced 2026-11-13 17:08:20 +00:00
refactor: better typing for tool icons
This commit is contained in:
@@ -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([]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user