Plan step 36 (containment group): <x-divider> moves its class lists into resources/css/components/divider.css, keyed on data-md-divider, data-md-orientation, data-md-inset/middle and data-md-divider-heading/ -text for the subheader form (DividerTokens.kt; docs/reference/m3 § Divider). Imported from the Containment block of components.css. Hooks renamed: none of divider's own (it had no data-* hooks before), but its rendered attribute order moved data-md-* ahead of role/aria-*, which ToolbarTest.php's regex for a toolbar's vertical divider depended on; fixed in the same commit. form.css picks up the @import './divider.css' its TODO(step 36) marker was waiting on, since form.blade.php renders <x-divider> and divider.css now carries the material.components layer. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9
33 lines
1.7 KiB
PHP
33 lines
1.7 KiB
PHP
<?php
|
|
|
|
it('separates horizontally or vertically, inset on request', function () {
|
|
expect((string) $this->blade('<x-divider />'))
|
|
->toContain('data-md-divider')
|
|
->toContain('data-md-orientation="horizontal"')
|
|
->toContain('role="separator"')
|
|
->toContain('aria-orientation="horizontal"')
|
|
->and((string) $this->blade('<x-divider vertical />'))
|
|
->toContain('data-md-orientation="vertical"')
|
|
->toContain('aria-orientation="vertical"')
|
|
->and((string) $this->blade('<x-divider inset />'))->toContain('data-md-inset')
|
|
->and((string) $this->blade('<x-divider decorative />'))->toContain('aria-hidden="true"')->not->toContain('role="separator"');
|
|
});
|
|
|
|
it('heads a group with a subheader, the rule running on from the words', function () {
|
|
$html = (string) $this->blade('<x-divider text="Recent" />');
|
|
|
|
expect($html)
|
|
->toContain('data-md-divider-heading')
|
|
->toContain('<span data-md-divider-text>Recent</span>')
|
|
->toMatch('/data-md-divider\s+data-md-orientation="horizontal"\s+role="separator" aria-orientation="horizontal"/')
|
|
->and(strpos($html, 'Recent'))->toBeLessThan(strpos($html, 'role="separator"'))
|
|
->and((string) $this->blade('<x-divider text="Recent" inset />'))->toContain('data-md-divider-heading')->toContain('data-md-inset')
|
|
->and((string) $this->blade('<x-divider text="Recent" decorative />'))
|
|
->toContain('>Recent</span>')
|
|
->toContain('aria-hidden="true"')
|
|
->not->toContain('role="separator"')
|
|
->and((string) $this->blade('<x-divider text="Recent" vertical />'))
|
|
->not->toContain('Recent')
|
|
->toContain('aria-orientation="vertical"');
|
|
});
|