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
@@ -17,27 +17,42 @@ use NoNameWeb\LivewireMaterial\Tests\Support\ViewClasses;
|
||||
* {name}.blade.php` file do not apply to it. It gets the three checks that do not depend on that
|
||||
* path below, and its own small versions of the other two.
|
||||
*/
|
||||
dataset('input components', [
|
||||
'form',
|
||||
'field',
|
||||
'input',
|
||||
'password',
|
||||
'textarea',
|
||||
'select',
|
||||
'file',
|
||||
'checkbox',
|
||||
'radio',
|
||||
'toggle',
|
||||
'chip',
|
||||
'chip-set',
|
||||
'choices',
|
||||
'slider',
|
||||
'search',
|
||||
'table',
|
||||
'sort-header',
|
||||
'datepicker',
|
||||
'timepicker',
|
||||
]);
|
||||
function inputComponents(): array
|
||||
{
|
||||
return [
|
||||
'form',
|
||||
'field',
|
||||
'input',
|
||||
'password',
|
||||
'textarea',
|
||||
'select',
|
||||
'file',
|
||||
'checkbox',
|
||||
'radio',
|
||||
'toggle',
|
||||
'chip',
|
||||
'chip-set',
|
||||
'choices',
|
||||
'slider',
|
||||
'search',
|
||||
'table',
|
||||
'sort-header',
|
||||
'datepicker',
|
||||
'timepicker',
|
||||
];
|
||||
}
|
||||
|
||||
dataset('input components', inputComponents());
|
||||
|
||||
/**
|
||||
* The checks that read a stylesheet alone also run on the one no view renders by itself:
|
||||
* selection.css, what the checkbox, radio and switch share (its own file header names them), which
|
||||
* each of their stylesheets imports. Nothing renders it directly and components.css never imports
|
||||
* it either — only checkbox.css, radio.css and toggle.css do — so without this its shape and token
|
||||
* rules would go unchecked, the way navigation-item.css did before NavigationStylesheetsTest.php
|
||||
* picked it up.
|
||||
*/
|
||||
dataset('input stylesheets', [...inputComponents(), 'selection']);
|
||||
|
||||
/**
|
||||
* Fails unless every media query in the stylesheet writes its lengths in px, at one of M3's four
|
||||
@@ -116,7 +131,7 @@ it('draws the component from a stylesheet shaped like every package stylesheet',
|
||||
foreach ($css->imports() as $import) {
|
||||
expect(is_file(dirname(ComponentStylesheet::path($name)).'/'.$import))->toBeTrue("{$name}.css imports {$import}, which does not exist");
|
||||
}
|
||||
})->with('input components');
|
||||
})->with('input stylesheets');
|
||||
|
||||
it('imports the stylesheet of every component its view renders', function (string $name) {
|
||||
preg_match_all('/<x-livewire-material::([a-z-]+)/', File::get(__DIR__."/../../../resources/views/components/{$name}.blade.php"), $tags);
|
||||
@@ -138,7 +153,7 @@ it('writes no class list into the view but the interaction and text classes', fu
|
||||
|
||||
it('takes its values from the tokens and its breakpoints in px', function (string $name) {
|
||||
assertTokensAndPxBreakpoints(ComponentStylesheet::read($name), "{$name}.css");
|
||||
})->with('input components');
|
||||
})->with('input stylesheets');
|
||||
|
||||
it('is imported from the inputs, selection and data block of components.css', function (string $name) {
|
||||
$components = File::get(__DIR__.'/../../../resources/css/components.css');
|
||||
|
||||
Reference in New Issue
Block a user