')
->toContain('')
->toContain('');
});
it('gives a medium or large bar a collapsed title in its row and the heading under it', function () {
$html = (string) $this->blade('');
expect($html)
->toContain('data-variant="large"')
->not->toContain('data-sticky')
->toContain('
')
->toContain('Settings')
->toContain('
')
->toContain('
Settings
');
});
it('puts a search bar in the row of a search app bar', function () {
expect((string) $this->blade(''))
->toContain('data-app-bar-search')
->toContain('placeholder="Search shares"');
});
it('falls back to a small bar and an h1 for unknown values', function () {
expect((string) $this->blade(''))
->toContain('data-variant="small"')
->toContain('
');
});
it('keeps two trailing icon buttons below medium and four from it, the rest in an overflow menu', function () {
$html = (string) $this->blade(<<<'BLADE'
BLADE);
preg_match('/data-app-bar-overflow="compact">(.*?)data-app-bar-overflow="medium">(.*)$/s', $html, $menus);
[, $compact, $medium] = $menus + [null, '', ''];
expect($html)
// M3's "up to four trailing icons" on a larger screen, the overflow button one of them: the
// first three are icon buttons, and the first stays one on a compact window too, beside the
// overflow button — M3's "up to two icon buttons" (navigation reference § Top app bar).
->and(substr_count($html, 'toBe(3)
->and(substr_count($html, 'data-overflows-compact'))->toBe(2)
->and($html)->toMatch('/\s*