Spaces:
Running
Running
| import { describe, expect, it } from 'vitest'; | |
| import { normalizeThemeMode, resolveThemeMode } from './theme'; | |
| describe('workspace theme', () => { | |
| it('falls back to the system theme for missing or invalid persisted values', () => { | |
| expect(normalizeThemeMode(null)).toBe('system'); | |
| expect(normalizeThemeMode('sepia')).toBe('system'); | |
| }); | |
| it('resolves system mode without overriding explicit light and dark choices', () => { | |
| expect(resolveThemeMode('system', true)).toBe('dark'); | |
| expect(resolveThemeMode('system', false)).toBe('light'); | |
| expect(resolveThemeMode('light', true)).toBe('light'); | |
| expect(resolveThemeMode('dark', false)).toBe('dark'); | |
| }); | |
| }); | |