fix: use sun as default admin icon

This commit is contained in:
Jakub Zych
2026-10-06 23:58:44 +02:00
parent 9fa714ff17
commit 4a94380b5f
2 changed files with 13 additions and 14 deletions

View File

@@ -85,7 +85,6 @@ import {
Settings,
ShieldCheck,
ShoppingCart,
Square,
Star,
Sun,
Table,
@@ -300,8 +299,8 @@ export const winterIcons: Readonly<Record<string, string>> = {
'icon-wrench': 'wrench',
}
/** Neutral icon for names neither lucide map knows. */
export const fallbackIcon: Component = Square
/** Brand icon for names neither lucide map knows. */
export const fallbackIcon: Component = Sun
/** An own entry of a map: names come from the server, so inherited object
* members such as "constructor" or "toString" never count as icons. */

View File

@@ -19,7 +19,7 @@ import {
Network,
Pencil,
Settings,
Square,
Sun,
Tags,
WandSparkles,
} from '@lucide/vue'
@@ -59,16 +59,16 @@ describe('iconFor', () => {
expect(iconFor('icon-edit')).toBe(Pencil)
})
it('falls back to the neutral square for unknown, empty or missing names', () => {
expect(fallbackIcon).toBe(Square)
expect(iconFor('unknown-icon-name')).toBe(Square)
expect(iconFor('icon-unknown')).toBe(Square)
expect(iconFor('')).toBe(Square)
expect(iconFor(null)).toBe(Square)
expect(iconFor(undefined)).toBe(Square)
expect(iconFor('constructor')).toBe(Square)
expect(iconFor('toString')).toBe(Square)
expect(iconFor('__proto__')).toBe(Square)
it('falls back to the sun for unknown, empty or missing names', () => {
expect(fallbackIcon).toBe(Sun)
expect(iconFor('unknown-icon-name')).toBe(Sun)
expect(iconFor('icon-unknown')).toBe(Sun)
expect(iconFor('')).toBe(Sun)
expect(iconFor(null)).toBe(Sun)
expect(iconFor(undefined)).toBe(Sun)
expect(iconFor('constructor')).toBe(Sun)
expect(iconFor('toString')).toBe(Sun)
expect(iconFor('__proto__')).toBe(Sun)
})
it('maps every Winter alias onto a registered lucide icon', () => {