Files
wehub-resource-sync 070959e133
landing-page-staging / Deploy landing page to staging (push) Has been skipped
landing-page-ci / Validate landing page (push) Failing after 4s
visual-baseline / Capture visual baselines (push) Has been cancelled
bake-plugin-previews / Bake plugin previews (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:00:47 +08:00

38 lines
1.2 KiB
TypeScript

import { describe, expect, it } from 'vitest';
import { readExpandedIndexCss } from '../helpers/read-expanded-css';
const indexCss = readExpandedIndexCss();
function cssBlock(selector: string): string {
const escaped = selector.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
const match = new RegExp(`${escaped}\\s*\\{([^}]*)\\}`).exec(indexCss);
if (!match) throw new Error(`Missing CSS block for ${selector}`);
return match[1] ?? '';
}
describe('default app background colors', () => {
it('uses the release light background color by default', () => {
const root = cssBlock(':root');
expect(root).toContain('--bg: #faf9f7;');
expect(root).toContain('--bg-app: #faf9f7;');
});
it('keeps the dark theme background unchanged', () => {
const dark = cssBlock('[data-theme="dark"]');
expect(dark).toContain('--bg: #1a1917;');
expect(dark).toContain('--bg-app: #1a1917;');
});
it('prefers platform UI fonts over optional local app fonts', () => {
const root = cssBlock(':root');
const sans = /--sans:\s*([^;]+);/.exec(root)?.[1];
expect(sans).toBeDefined();
expect(sans).toContain("'Segoe UI'");
expect(sans).not.toContain("'Inter'");
expect(sans).toMatch(/'Segoe UI', 'Microsoft YaHei UI', 'Noto Sans'/);
});
});