File size: 686 Bytes
6c62075
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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');
  });
});