mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-01 22:46:38 +08:00
[优化] 格式化
This commit is contained in:
@@ -1 +1 @@
|
||||
import '@testing-library/jest-dom/vitest';
|
||||
import '@testing-library/jest-dom/vitest';
|
||||
|
||||
@@ -180,7 +180,10 @@ describe('Proxy route website pages', () => {
|
||||
primary_domain: payload.domain,
|
||||
domain_count: payload.domains.length,
|
||||
origin_url: payload.origin_url,
|
||||
upstreams: JSON.stringify([payload.origin_url, ...payload.upstreams]),
|
||||
upstreams: JSON.stringify([
|
||||
payload.origin_url,
|
||||
...payload.upstreams,
|
||||
]),
|
||||
upstream_list: [payload.origin_url, ...payload.upstreams],
|
||||
enabled: payload.enabled,
|
||||
enable_https: payload.enable_https,
|
||||
@@ -242,7 +245,9 @@ describe('Proxy route website pages', () => {
|
||||
JSON.stringify({
|
||||
success: true,
|
||||
message: '',
|
||||
data: [{ id: 1, domain: '*.example.com', cert_id: 1, enabled: true }],
|
||||
data: [
|
||||
{ id: 1, domain: '*.example.com', cert_id: 1, enabled: true },
|
||||
],
|
||||
}),
|
||||
),
|
||||
);
|
||||
@@ -377,7 +382,9 @@ describe('Proxy route website pages', () => {
|
||||
JSON.stringify({
|
||||
success: true,
|
||||
message: '',
|
||||
data: [{ id: 1, domain: '*.example.com', cert_id: 1, enabled: true }],
|
||||
data: [
|
||||
{ id: 1, domain: '*.example.com', cert_id: 1, enabled: true },
|
||||
],
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -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');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user