Files
coolify/tests/Feature/GlobalSearchLoadingStateTest.php
T
Andras Bacsai a37f1369c8 fix(ui): skip hidden global search results in keyboard nav
Limit navigateResults to visible .search-result-item nodes under the
search root so hidden command palette entries are not focused.
2026-08-07 18:01:43 +02:00

35 lines
1.6 KiB
PHP

<?php
it('shows a loading overlay while resource selection steps load', function () {
$view = file_get_contents(resource_path('views/livewire/global-search.blade.php'));
expect($view)
->toContain('wire:loading.class="pointer-events-none opacity-40 blur-[2px]"')
->toContain('wire:loading.flex')
->toContain('selectServer,selectDestination,selectProject,selectEnvironment')
->toContain('Loading selection…')
->toContain('isPaletteTransitioning')
->toContain('runPaletteTransition')
->toContain('Loading…');
});
it('uses a single Alpine result renderer for every command palette result type', function () {
$view = file_get_contents(resource_path('views/livewire/global-search.blade.php'));
expect($view)
->not->toContain('Create mode (server-rendered path)')
->not->toContain('!$wire.isCreateMode')
->toContain("<!-- Command palette -->\n <div x-show=\"modalOpen\"")
->not->toContain("<!-- Command palette -->\n <template x-teleport=\"body\">")
->toContain("<div wire:ignore>\n <template x-if=\"searchQuery.length")
->toContain('x-for="(result, index) in searchResults"')
->toContain('x-for="[categoryName, items] in Object.entries(groupedCreatableItems)"');
});
it('skips hidden command palette results during keyboard navigation', function () {
$view = file_get_contents(resource_path('views/livewire/global-search.blade.php'));
expect($view)
->toContain('filter(item => item.offsetParent !== null)');
});