- Add GearSix icon ('gear-six') to icon registry — was missing, causing
Config type to show FileText fallback instead of its configured icon
- Add 'gray' to ACCENT_COLORS palette with CSS variables — was missing,
causing Config type color to fall back to muted foreground
- Extract sidebar section logic to utils/sidebarSections.ts for testability
- Add Config type + instance to mock entries for browser dev mode
- Add tests: icon resolution, gray color, sidebar section builder
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
28 lines
784 B
TypeScript
28 lines
784 B
TypeScript
import { describe, it, expect } from 'vitest'
|
|
import { resolveIcon, ICON_OPTIONS } from './iconRegistry'
|
|
import { FileText, GearSix, CookingPot } from '@phosphor-icons/react'
|
|
|
|
describe('resolveIcon', () => {
|
|
it('returns FileText for null', () => {
|
|
expect(resolveIcon(null)).toBe(FileText)
|
|
})
|
|
|
|
it('returns FileText for unknown icon name', () => {
|
|
expect(resolveIcon('nonexistent-icon')).toBe(FileText)
|
|
})
|
|
|
|
it('resolves gear-six to GearSix', () => {
|
|
expect(resolveIcon('gear-six')).toBe(GearSix)
|
|
})
|
|
|
|
it('resolves cooking-pot to CookingPot', () => {
|
|
expect(resolveIcon('cooking-pot')).toBe(CookingPot)
|
|
})
|
|
})
|
|
|
|
describe('ICON_OPTIONS', () => {
|
|
it('includes gear-six', () => {
|
|
expect(ICON_OPTIONS.some((o) => o.name === 'gear-six')).toBe(true)
|
|
})
|
|
})
|