From cc241f0b7eaaf3fb796d6d4189eb24cd4c617524 Mon Sep 17 00:00:00 2001 From: simoleo89 Date: Tue, 25 Aug 2026 20:29:08 +0200 Subject: [PATCH] test: cover housekeeping palette utilities --- .../foundation/shell/housekeeping-shell.test.tsx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/features/housekeeping/foundation/shell/housekeeping-shell.test.tsx b/src/features/housekeeping/foundation/shell/housekeeping-shell.test.tsx index fdc88b7a..0aac7178 100644 --- a/src/features/housekeeping/foundation/shell/housekeeping-shell.test.tsx +++ b/src/features/housekeeping/foundation/shell/housekeeping-shell.test.tsx @@ -86,7 +86,7 @@ const structuralBoundaryRules = [ { label: "palette color", pattern: - /(?:bg|text|border|from|to)-(?:white|black|slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)(?:-\d{2,3})?/, + /(?:bg|text|border|from|via|to|ring|outline|fill|stroke|divide|shadow|accent|caret|decoration|placeholder)-(?:white|black|slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)(?:-\d{2,3})?/, }, { label: "hex color", pattern: new RegExp("#" + "[0-9a-fA-F]{3,8}") }, { @@ -302,4 +302,18 @@ describe("HousekeepingShell", () => { ), ).toContain("palette color"); }); + it("detects hard-coded Tailwind color utilities beyond foreground and backgrounds", () => { + for (const source of [ + 'className="ring-' + 'red-500"', + 'className="outline-' + 'blue-500"', + 'className="fill-' + 'green-500"', + 'className="stroke-' + 'purple-500"', + 'className="divide-' + 'amber-400"', + 'className="via-' + 'cyan-500"', + ]) { + expect(boundaryViolations(source, structuralBoundaryRules)).toContain( + "palette color", + ); + } + }); });