mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix: update all renamed Lucide icons and make icon test dynamic (#150)
- FileEdit -> FilePen (bulk-rename tool) - Wand2 -> Wand (object eraser) - Columns -> Columns2 (stitch tool) - Add Expand to ICON_MAP (ai-canvas-expand) - Make icon-map test derive icon lists from shared constants instead of hardcoding names, preventing future breakage on icon renames
This commit is contained in:
@@ -11,11 +11,12 @@ import {
|
||||
Crosshair,
|
||||
Droplets,
|
||||
Eraser,
|
||||
Expand,
|
||||
Eye,
|
||||
EyeOff,
|
||||
FileEdit,
|
||||
FileImage,
|
||||
FileOutput,
|
||||
FilePen,
|
||||
FileText,
|
||||
FileType,
|
||||
Film,
|
||||
@@ -72,9 +73,10 @@ export const ICON_MAP: Record<string, LucideIcon> = {
|
||||
Crosshair,
|
||||
Droplets,
|
||||
Eraser,
|
||||
Expand,
|
||||
Eye,
|
||||
EyeOff,
|
||||
FileEdit,
|
||||
FilePen,
|
||||
FileImage,
|
||||
FileOutput,
|
||||
FileText,
|
||||
|
||||
@@ -84,7 +84,7 @@ export const TOOLS: Tool[] = [
|
||||
name: "Bulk Rename",
|
||||
description: "Rename multiple files with patterns",
|
||||
category: "optimization",
|
||||
icon: "FileEdit",
|
||||
icon: "FilePen",
|
||||
route: "/bulk-rename",
|
||||
},
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// @vitest-environment jsdom
|
||||
import { CATEGORIES, TOOLS } from "@snapotter/shared";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { ICON_MAP } from "@/lib/icon-map";
|
||||
|
||||
@@ -17,63 +18,16 @@ describe("ICON_MAP", () => {
|
||||
});
|
||||
|
||||
it("contains all category icons referenced by shared constants", () => {
|
||||
const categoryIcons = [
|
||||
"Layers",
|
||||
"Zap",
|
||||
"SlidersHorizontal",
|
||||
"Stamp",
|
||||
"Wrench",
|
||||
"LayoutGrid",
|
||||
"FileType",
|
||||
"Sparkles",
|
||||
];
|
||||
const categoryIcons = [...new Set(CATEGORIES.map((c) => c.icon))];
|
||||
for (const icon of categoryIcons) {
|
||||
expect(ICON_MAP[icon]).toBeDefined();
|
||||
expect(ICON_MAP[icon], `ICON_MAP missing category icon "${icon}"`).toBeDefined();
|
||||
}
|
||||
});
|
||||
|
||||
it("contains all tool icons referenced by shared constants", () => {
|
||||
const toolIcons = [
|
||||
"Maximize2",
|
||||
"Crop",
|
||||
"RotateCw",
|
||||
"FileOutput",
|
||||
"Minimize2",
|
||||
"Globe",
|
||||
"ShieldOff",
|
||||
"PenLine",
|
||||
"FileEdit",
|
||||
"FileText",
|
||||
"Focus",
|
||||
"Pipette",
|
||||
"Eraser",
|
||||
"ZoomIn",
|
||||
"Wand2",
|
||||
"ScanText",
|
||||
"EyeOff",
|
||||
"ScanFace",
|
||||
"Palette",
|
||||
"Eye",
|
||||
"Undo2",
|
||||
"UserCheck",
|
||||
"Type",
|
||||
"Image",
|
||||
"TextCursorInput",
|
||||
"Info",
|
||||
"Columns2",
|
||||
"Copy",
|
||||
"QrCode",
|
||||
"ScanLine",
|
||||
"Code",
|
||||
"Columns",
|
||||
"Grid3x3",
|
||||
"Frame",
|
||||
"FileImage",
|
||||
"PenTool",
|
||||
"Film",
|
||||
];
|
||||
const toolIcons = [...new Set(TOOLS.map((t) => t.icon))];
|
||||
for (const icon of toolIcons) {
|
||||
expect(ICON_MAP[icon]).toBeDefined();
|
||||
expect(ICON_MAP[icon], `ICON_MAP missing "${icon}"`).toBeDefined();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user