')
->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('draws floating and docked toolbars', function () {
$html = (string) $this->blade(<<<'BLADE'
BLADE);
expect($html)
->toContain('
')
->toContain('role="toolbar"')
->toContain('materialToolbar(true)')
->toContain('data-variant="floating"')
->toContain('aria-orientation="vertical"')
->toContain('data-vibrant')
->toContain('aria-label="Formatting"')
->toContain('')
->and((string) $this->blade(''))
->toContain('data-variant="docked"')
->not->toContain('data-vibrant')
->not->toContain('data-vertical')
->toContain('data-toolbar-place="bottom"')
->not->toContain('data-toolbar-group');
});
it('switches the theme through the store in three shapes', function () {
expect((string) $this->blade(''))
->toContain('data-theme-toggle="toggle"')
->toContain('aria-label="Dark theme"')
->toContain('$store.theme.toggle()')
->and((string) $this->blade(''))
->toContain('data-theme-toggle="cycle"')
->toContain("{ light: 'dark', dark: 'system', system: 'light' }")
->and((string) $this->blade(''))
->toContain('role="radiogroup"')
->toContain('data-theme-option="system"')
->toContain("\$store.theme.set('dark')");
});
it('opens an account menu from the initials of a name', function () {
$html = (string) $this->blade(<<<'BLADE'
BLADE);
expect($html)
->toContain('aria-label="Account"')
->toContain('data-account-menu')
->toMatch('/>\s*AM\s*<\/button>/')
->toContain('anna@example.com')
->toContain('Settings')
->toContain('data-account-theme')
->toContain('Sign out')
->and((string) $this->blade(''))
->toContain('not->toContain('data-account-theme');
});