refactor(ui): FilterSelect and Combobox draw their checks with MenuCheck
They still painted their own 14px box beside the menus' 16px MenuCheck. A contract test holds the filled-box paint to MenuCheck alone.
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { readdirSync, readFileSync } from "node:fs";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
// E28 review L2: `ui/MenuCheck` is the ONE drawn check box of a checkable row (S3e3b replaced seven
|
||||
// hand-drawn copies), yet FilterSelect and Combobox still painted their own — a 14px box beside the
|
||||
// menus' 16px one. The filled-box paint is the tell: it may live in MenuCheck only.
|
||||
describe("the drawn check box", () => {
|
||||
it("is painted by MenuCheck alone", () => {
|
||||
const root = new URL("../", import.meta.url);
|
||||
const offenders = readdirSync(root, { recursive: true, encoding: "utf8" })
|
||||
.filter((f) => f.endsWith(".tsx") && !f.includes(".test.") && !f.endsWith("MenuCheck.tsx"))
|
||||
.filter((f) =>
|
||||
/border-accent bg-accent text-accent-fg/.test(
|
||||
readFileSync(new URL(f.replace(/\\/g, "/"), root), "utf8"),
|
||||
),
|
||||
);
|
||||
expect(offenders).toEqual([]);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user