Bonsai-Chat-WebGPU / src /app /theme.test.ts
Valeriy Selitskiy
Release v1.2.1 adaptive chat workspace
6c62075
Raw
History Blame Contribute Delete
686 Bytes
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');
});
});