Files
bchen-ui/tests/base.test.ts
Brendan Chen 8511e0c720 refactor: deduplicate CSS parser helpers and drop redundant base test
- Collapse extractRootBlock + extractDarkBlock into a single extractBlock
  helper; the two functions shared identical body logic (same regex, same
  return) and differed only in the string they received — now the call
  sites pass the appropriate slice inline.
- Remove the second test in base.test.ts ("covers all three form control
  selectors in one rule"): the first test's regex already asserts all
  three selectors appear together with font-size: 16px, so the individual
  /input/, /textarea/, /select/ matches added no coverage.
2026-05-13 17:58:47 -07:00

12 lines
361 B
TypeScript

import { describe, it, expect } from 'vitest';
import { readFileSync } from 'fs';
const css = readFileSync(new URL('../dist/base.css', import.meta.url), 'utf-8');
describe('base.css', () => {
it('sets font-size: 16px on input, textarea, select', () => {
expect(css).toMatch(/input\s*,\s*textarea\s*,\s*select\s*\{[^}]*font-size\s*:\s*16px/);
});
});