fix: use sun as default admin icon
This commit is contained in:
@@ -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. */
|
||||
|
||||
@@ -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', () => {
|
||||
|
||||
Reference in New Issue
Block a user