blade(''); expect($html) ->toContain('x-persist="material-toast"') ->toContain('x-data="materialSnackbar"') ->toContain('bg-inverse-surface') ->toContain('justify-center'); }); it('can sit at the start', function () { expect((string) $this->blade(''))->toContain('justify-start'); }); it('marks the snackbar and its action for tests and styling', function () { $html = (string) $this->blade(''); expect($html) ->toMatch('/]*\bdata-toast\b/') ->toMatch('/]*\bdata-toast-action\b[^>]*x-on:click="act\(\)"/'); }); it('keeps the live region in the page, polite, around the snackbar that comes and goes', function () { $html = (string) $this->blade(''); expect($html) ->toMatch('/]*x-data="materialSnackbar"[^>]*aria-live="polite"/') ->toContain('aria-atomic="true"') ->toContain("x-bind:role=\"current && (current.type === 'error' || current.type === 'warning') ? 'alert' : 'status'\"") ->and(substr_count($html, 'aria-live'))->toBe(1); });