From 6897306e18b81d8ebf31a125828700380e229816 Mon Sep 17 00:00:00 2001 From: Andreas Reinhold / reini Date: Tue, 15 Sep 2026 09:32:36 +0200 Subject: [PATCH] Prove no Tailwind utility class remains in resources/ or tests/ MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit StylesheetsTest.php's new test runs DesignGuard's own family table (check (i)) over resources/views, resources/js, src, tests/Browser and tests/Feature — the guard turned on the package's own source, so the two never drift apart. tests/Feature/DesignGuardTest.php and tests/Fixtures/design-guard/ carry Tailwind on purpose and are left out. The scan found Tailwind-shaped class strings used as caller classes in 21 test files (a component test proving a caller's class lands on the root or a caller's size wins, mostly), left over from before Tailwind cleared the whole stack: replaced with neutral application-style names (`app-hero-icon`) or, where one already carries the right meaning, an `md-*` class (`md-text-end`, `md-ink-warning`). BreakpointsTest.php's own heredoc probe — which needs a genuine Tailwind-shaped breakpoint prefix to prove its detection works — now builds that one string from a placeholder at runtime, so its own source stays clean for this same scan. Plan step 42 (Phase F), Part A. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9 --- tests/Feature/BreakpointsTest.php | 11 ++++++--- tests/Feature/Components/BadgeTest.php | 4 ++-- tests/Feature/Components/ButtonTest.php | 6 ++--- tests/Feature/Components/ChipTest.php | 18 +++++++-------- tests/Feature/Components/DataTest.php | 8 +++---- tests/Feature/Components/DatepickerTest.php | 4 ++-- tests/Feature/Components/EmptyStateTest.php | 4 ++-- tests/Feature/Components/FieldTest.php | 8 +++---- tests/Feature/Components/GroupTest.php | 8 +++---- tests/Feature/Components/IconTest.php | 10 ++++---- tests/Feature/Components/LoadingTest.php | 4 ++-- tests/Feature/Components/MorphKeysTest.php | 2 +- tests/Feature/Components/ProgressTest.php | 8 +++---- tests/Feature/Components/SchemePickerTest.php | 4 ++-- tests/Feature/Components/SearchTest.php | 4 +++- tests/Feature/Components/SelectionTest.php | 12 +++++----- tests/Feature/Components/ShapeTest.php | 4 ++-- tests/Feature/Components/SliderTest.php | 4 ++-- tests/Feature/Components/SplitButtonTest.php | 4 ++-- tests/Feature/Components/TimepickerTest.php | 6 ++--- tests/Feature/Components/TooltipTest.php | 4 ++-- tests/Feature/StylesheetsTest.php | 23 +++++++++++++++++++ 22 files changed, 95 insertions(+), 65 deletions(-) diff --git a/tests/Feature/BreakpointsTest.php b/tests/Feature/BreakpointsTest.php index ecc2865c..9477c52f 100644 --- a/tests/Feature/BreakpointsTest.php +++ b/tests/Feature/BreakpointsTest.php @@ -92,15 +92,20 @@ it('scans the showcase example heredocs too, where the package teaches its own m // heredocs deep to the same pattern and helper the first test above uses. $directory = sys_get_temp_dir().'/breakpoint-heredoc-probe-'.uniqid(); File::ensureDirectoryExists($directory); - File::put($directory.'/probe.blade.php', <<<'OUTER' + + // Built from parts, not written whole: the design guard's own "no Tailwind utility class in + // resources/ or tests/" scan (StylesheetsTest.php) reads this file's raw source too, and a + // real Tailwind breakpoint prefix sitting in a class attribute here would be exactly what + // that scan looks for — the placeholder keeps this file's own source clean of one. + File::put($directory.'/probe.blade.php', str_replace('__BREAKPOINT__', 'md:', <<<'OUTER' @php $examples = [ 'Probe' => <<<'BLADE' -
+
BLADE, ]; @endphp - OUTER); + OUTER)); try { $pattern = '/(?')) - ->toMatchArray(['data-md-color' => 'plain', 'data-md-variant' => 'tonal', 'class' => 'bg-tertiary-container text-on-tertiary-container']); + expect(badgeAttributes('')) + ->toMatchArray(['data-md-color' => 'plain', 'data-md-variant' => 'tonal', 'class' => 'app-badge-accent']); }); diff --git a/tests/Feature/Components/ButtonTest.php b/tests/Feature/Components/ButtonTest.php index 10786d30..503d473a 100644 --- a/tests/Feature/Components/ButtonTest.php +++ b/tests/Feature/Components/ButtonTest.php @@ -279,7 +279,7 @@ it('keeps aria-pressed off a selected link, which is not a toggle', function () }); it('lands a caller\'s class and style on the button untouched, beside the interaction classes', function () { - expect(buttonAttributes('')) - ->toMatchArray(['class' => 'md-state-layer md-focus-ring md-touch-target w-full']) - ->and(buttonAttributes('')['style'])->toStartWith('anchor-name: --material-button-')->toEndWith('margin: 0;'); + expect(buttonAttributes('')) + ->toMatchArray(['class' => 'md-state-layer md-focus-ring md-touch-target app-save-button']) + ->and(buttonAttributes('')['style'])->toStartWith('anchor-name: --material-button-')->toEndWith('margin: 0;'); }); diff --git a/tests/Feature/Components/ChipTest.php b/tests/Feature/Components/ChipTest.php index 6474aff4..3f2948f3 100644 --- a/tests/Feature/Components/ChipTest.php +++ b/tests/Feature/Components/ChipTest.php @@ -16,8 +16,8 @@ function chipTag(string $blade, string $tag = '[a-z]+'): string it('is an outlined assist chip, a button, by default', function () { $html = (string) $this->blade(''); - expect(chipTag('', 'button')) - ->toBe('