import { commands, CommandItem } from '@/lib/command-items' describe('command-items', () => { describe('commands array', () => { it('contains navigation commands', () => { const navCommands = commands.filter((cmd) => cmd.group === 'navigation') expect(navCommands.length).toBeGreaterThan(0) expect(navCommands.some((cmd) => cmd.id === 'nav-dashboard')).toBe(true) expect(navCommands.some((cmd) => cmd.id === 'nav-notes')).toBe(true) expect(navCommands.some((cmd) => cmd.id === 'nav-settings')).toBe(true) }) it('contains action commands', () => { const actionCommands = commands.filter((cmd) => cmd.group === 'actions') expect(actionCommands.length).toBeGreaterThan(0) expect(actionCommands.some((cmd) => cmd.id === 'action-new')).toBe(true) }) }) describe('command item structure', () => { it('each command has required fields', () => { commands.forEach((cmd: CommandItem) => { expect(cmd.id).toBeDefined() expect(cmd.label).toBeDefined() expect(cmd.group).toBeDefined() expect(typeof cmd.id).toBe('string') expect(typeof cmd.label).toBe('string') expect(['navigation', 'actions', 'search', 'recent']).toContain(cmd.group) }) }) it('commands have keywords for search', () => { commands.forEach((cmd: CommandItem) => { if (cmd.keywords) { expect(Array.isArray(cmd.keywords)).toBe(true) } }) }) }) describe('command filtering', () => { it('can filter by label', () => { const filtered = commands.filter((cmd) => cmd.label.toLowerCase().includes('dashboard') ) expect(filtered.length).toBeGreaterThan(0) }) it('can filter by keywords', () => { const filtered = commands.filter((cmd) => cmd.keywords?.some((k) => k.includes('home')) ) expect(filtered.length).toBeGreaterThan(0) }) }) })