blade('')) ->toContain('toContain('data-navigation-bar-items') ->and((string) $this->blade(''))->toContain('aria-label="Sections"'); }); it('links a destination through wire:navigate unless told not to', function () { expect((string) $this->blade('')) ->toContain('toContain('href="/inbox"') ->toContain('wire:navigate') ->and((string) $this->blade(''))->not->toContain('wire:navigate') ->and((string) $this->blade('')) ->toContain('target="_blank"') ->not->toContain('wire:navigate'); }); it('is a button without a link', function () { expect((string) $this->blade('')) ->toContain('toContain('type="button"') ->not->toContain('href='); }); it('marks the current destination with aria-current and the filled icon', function () { $active = (string) $this->blade(''); $inactive = (string) $this->blade(''); $symbol = fn (string $html): string => preg_match('//s', $html, $svg) ? $svg[0] : ''; expect($active)->toContain('aria-current="page"')->toContain('data-active') ->and($inactive)->not->toContain('aria-current')->not->toContain('data-active') ->and($symbol($active))->toBe(trim((string) $this->blade(''))) ->and($symbol($inactive))->toBe(trim((string) $this->blade(''))) ->and($symbol($active))->not->toBe($symbol($inactive)); }); it('badges the icon with a dot or a count that screen readers hear', function () { $count = (string) $this->blade(''); $dot = (string) $this->blade(''); expect($count)->toContain('999+')->toContain(', 1200') ->and($dot)->toContain('size-1.5')->toContain(', New mail') ->and((string) $this->blade(''))->not->toContain('sr-only'); });