mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-09-29 22:06:38 +08:00
20 lines
688 B
TypeScript
20 lines
688 B
TypeScript
import { describe, expect, it } from 'vitest';
|
|
|
|
import { isThemeMode, resolveTheme } from '@/lib/theme/theme';
|
|
|
|
describe('theme utils', () => {
|
|
it('validates theme mode values', () => {
|
|
expect(isThemeMode('light')).toBe(true);
|
|
expect(isThemeMode('dark')).toBe(true);
|
|
expect(isThemeMode('system')).toBe(true);
|
|
expect(isThemeMode('custom')).toBe(false);
|
|
});
|
|
|
|
it('resolves system mode using system preference', () => {
|
|
expect(resolveTheme('system', true)).toBe('dark');
|
|
expect(resolveTheme('system', false)).toBe('light');
|
|
expect(resolveTheme('dark', false)).toBe('dark');
|
|
expect(resolveTheme('light', true)).toBe('light');
|
|
});
|
|
});
|