[优化] 格式化

This commit is contained in:
ryan
2026-05-30 13:15:20 +08:00
parent 28b1305906
commit 9ec3d5b42d
110 changed files with 29155 additions and 7642 deletions
@@ -1,19 +1,19 @@
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');
});
});
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');
});
});