feat: 更新嵌入式文件系统逻辑,支持路径清理和静态资源请求处理,增强前端主题切换能力

This commit is contained in:
ryan
2026-03-11 13:18:32 +08:00
parent 6eea676f8f
commit ad090c9c04
26 changed files with 465 additions and 81 deletions
@@ -0,0 +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');
});
});