Check icon.css, shape.css and selection.css like every other stylesheet
Review leftover (plan step 36): none of the three foundation/shared stylesheets was in a group dataset, so their shape, token and breakpoint rules went unchecked. icon and shape have views of their own and sit in components.css's first block, so they join ActionStylesheetsTest's dataset outright, with that file's block check narrowed to look for them there instead of the actions block. selection.css has no view (checkbox, radio and toggle each import it) and components.css never imports it directly, so it follows navigation-item.css's pattern in InputStylesheetsTest: a second, stylesheet-only dataset alongside the view-based one. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
66847d5104
commit
f53bee9ef3
@@ -11,8 +11,16 @@ use NoNameWeb\LivewireMaterial\Tests\Support\ViewClasses;
|
||||
* `material.components` that imports the stylesheets of the components its view renders, writes
|
||||
* its values from the tokens and its breakpoints as px range queries, and is imported from the
|
||||
* "Actions and communication" block of components.css.
|
||||
*
|
||||
* `icon` and `shape` are the two foundation components (`<x-icon>`, `<x-shape>`) — no group's view
|
||||
* renders them exclusively, so they were in no group's dataset at all. They follow the same shape,
|
||||
* token and view-class rules as every other component, so they run with this group's checks too;
|
||||
* only "is imported from the actions and communication block" needs to read the two of them from
|
||||
* components.css's first block ("Foundation components") instead, since that is where they sit.
|
||||
*/
|
||||
dataset('action components', [
|
||||
'icon',
|
||||
'shape',
|
||||
'loading',
|
||||
'tooltip',
|
||||
'badge',
|
||||
@@ -87,10 +95,16 @@ it('takes its values from the tokens and its breakpoints in px', function (strin
|
||||
}
|
||||
})->with('action components');
|
||||
|
||||
it('is imported from the actions and communication block of components.css', function (string $name) {
|
||||
it('is imported from the actions and communication block of components.css, or icon and shape from the foundation block before it', function (string $name) {
|
||||
$components = File::get(__DIR__.'/../../../resources/css/components.css');
|
||||
$block = substr($components, (int) strpos($components, '/* Actions and communication */'));
|
||||
$block = substr($block, 0, (int) strpos($block, '/* Inputs, selection and data */'));
|
||||
|
||||
if (in_array($name, ['icon', 'shape'], true)) {
|
||||
$block = substr($components, (int) strpos($components, '/* Foundation components */'));
|
||||
$block = substr($block, 0, (int) strpos($block, '/* Actions and communication */'));
|
||||
} else {
|
||||
$block = substr($components, (int) strpos($components, '/* Actions and communication */'));
|
||||
$block = substr($block, 0, (int) strpos($block, '/* Inputs, selection and data */'));
|
||||
}
|
||||
|
||||
expect($block)->toContain("@import './components/{$name}.css';");
|
||||
})->with('action components');
|
||||
|
||||
Reference in New Issue
Block a user