import { describe, it, expect } from 'vitest'; import { BUILTIN_THEMES } from '../builtin-themes'; describe('BUILTIN_THEMES', () => { it('contains exactly 8 themes', () => { // 6 generic built-ins (author: 'Built-in') + 2 VNC brand themes // (VNClagoon, SRC — author: 'VNC'), added this week. expect(BUILTIN_THEMES).toHaveLength(8); }); it('all themes have required fields', () => { for (const theme of BUILTIN_THEMES) { expect(theme.id).toBeTruthy(); expect(theme.name).toBeTruthy(); expect(theme.version).toBeTruthy(); expect(['Built-in', 'VNC']).toContain(theme.author); expect(theme.css).toBeTruthy(); expect(theme.variants).toEqual(['light', 'dark']); expect(theme.enabled).toBe(true); expect(theme.builtIn).toBe(true); } }); it('all IDs are prefixed with builtin-', () => { for (const theme of BUILTIN_THEMES) { expect(theme.id).toMatch(/^builtin-/); } }); it('all themes have both :root and .dark selectors', () => { for (const theme of BUILTIN_THEMES) { expect(theme.css).toContain(':root'); expect(theme.css).toContain('.dark'); } }); it('all themes set --color-primary', () => { for (const theme of BUILTIN_THEMES) { expect(theme.css).toContain('--color-primary:'); } }); it('themes have correct names', () => { const names = BUILTIN_THEMES.map(t => t.name); expect(names).toContain('Nord'); expect(names).toContain('Catppuccin'); expect(names).toContain('Solarized'); expect(names).toContain('Roundcube Elastic'); expect(names).toContain('Aurora Glass'); expect(names).toContain('VNClagoon'); expect(names).toContain('SRC'); }); it('theme IDs are unique', () => { const ids = BUILTIN_THEMES.map(t => t.id); expect(new Set(ids).size).toBe(ids.length); }); });