Files
2026-06-25 19:06:59 -04:00

19 lines
734 B
TypeScript

import { isThemePreference, resolveTheme, serverResolvedTheme } from '@/lib/theme/config';
import { describe, expect, it } from 'vitest';
describe('theme foundations', () => {
it('accepts only approved preferences', () => {
expect(isThemePreference('light')).toBe(true);
expect(isThemePreference('dark')).toBe(true);
expect(isThemePreference('system')).toBe(true);
expect(isThemePreference('sepia')).toBe(false);
});
it('keeps preference and resolved theme separate', () => {
expect(resolveTheme('system', true)).toBe('dark');
expect(resolveTheme('system', false)).toBe('light');
expect(resolveTheme('light', true)).toBe('light');
expect(serverResolvedTheme('system')).toBe('light');
});
});