')
->and((string) $this->blade(''))->toContain('data-md-size="xs"')
->and((string) $this->blade(''))->toContain('data-md-size="sm"');
});
it('tightens a table only when the caller asks for it', function () {
expect((string) $this->blade(''))->not->toContain('data-md-dense')
->and((string) $this->blade(''))->toContain('data-md-dense');
});
it('draws 52px rows, 36px dense ones, from its stylesheet in the components layer', function () {
$css = (string) file_get_contents(__DIR__.'/../../../resources/css/components/table.css');
expect($css)->toContain('@layer material.components')
->toMatch('/\\[data-md-table\\] \\{\\s*--cell-x: 12px;\\s*--cell-y: var\\(--md-sys-measurement-space200\\);/')
->toMatch('/\\[data-md-table\\]\\[data-md-dense\\] \\{\\s*--cell-y: var\\(--md-sys-measurement-space100\\);/')
->toContain('[data-md-table] :where(tbody tr[aria-selected=\'true\'])')
->and((string) file_get_contents(__DIR__.'/../../../resources/css/components.css'))->toContain("@import './components/table.css';")
->and((string) file_get_contents(__DIR__.'/../../../resources/css/tailwind.css'))->not->toContain('table.css');
});
it('sorts by its column, ascending first and then flipping', function () {
expect((string) $this->blade('Size'))
->not->toContain('aria-sort')
->toContain('wire:click="$set(\'sortBy\', {"column":"size","direction":"asc"})"')
->and((string) $this->blade('Size'))
->toContain('aria-sort="ascending"')
->toMatch('/
/')
->toContain('$set(\'order\', {"column":"size","direction":"desc"})')
->and((string) $this->blade('Size'))
->toContain('aria-sort="descending"')
->toContain('"direction":"asc"');
});
it('gives the sort button and every page control a 48px target', function () {
$pages = new LengthAwarePaginator(range(1, 10), 95, 10, 3, ['path' => '/shares']);
expect((string) $this->blade('Size'))
->toMatch('/