2026-06-05 11:31:20 +00:00
|
|
|
<?php
|
|
|
|
|
|
2026-08-05 17:54:48 +00:00
|
|
|
it('collapses server subsystem badges into one status summary', function () {
|
2026-06-05 11:31:20 +00:00
|
|
|
$navbarView = file_get_contents(resource_path('views/livewire/server/navbar.blade.php'));
|
2026-08-05 17:54:48 +00:00
|
|
|
$summaryView = file_get_contents(resource_path('views/components/server/status-summary.blade.php'));
|
2026-06-05 11:31:20 +00:00
|
|
|
$badgeView = file_get_contents(resource_path('views/components/status-badge.blade.php'));
|
|
|
|
|
|
|
|
|
|
expect($navbarView)
|
2026-08-05 17:54:48 +00:00
|
|
|
->toContain('<x-server.status-summary')
|
|
|
|
|
->not->toContain('label="Proxy" status="Running"')
|
|
|
|
|
->not->toContain('label="Sentinel"')
|
|
|
|
|
->and($summaryView)
|
|
|
|
|
->toContain("['Attention required', 'warning']")
|
|
|
|
|
->toContain("['Ready', 'success']")
|
|
|
|
|
->toContain('System status')
|
2026-08-06 16:15:58 +00:00
|
|
|
->toContain('aria-label="Refresh status"')
|
2026-08-05 17:54:48 +00:00
|
|
|
->toContain('<x-reicon name="chevron-down"')
|
|
|
|
|
->toContain(":class=\"open && 'rotate-180'\"")
|
|
|
|
|
->toContain('wire:click="checkProxyStatus"')
|
2026-08-06 16:15:58 +00:00
|
|
|
->toContain('wire:loading.class="animate-spin" wire:target="checkProxyStatus"')
|
|
|
|
|
->toContain('name="refresh" class="size-3"')
|
|
|
|
|
->not->toContain('Refreshing status')
|
|
|
|
|
->not->toContain('<x-loading compact />')
|
2026-08-06 13:37:30 +00:00
|
|
|
->toContain("href=\"{{ route('server.proxy', ['server_uuid' => \$server->uuid]) }}\"")
|
|
|
|
|
->toContain("href=\"{{ route('server.sentinel', ['server_uuid' => \$server->uuid]) }}\"")
|
|
|
|
|
->toContain('@click="open = false" role="menuitem"');
|
2026-06-05 11:31:20 +00:00
|
|
|
|
|
|
|
|
expect($badgeView)
|
|
|
|
|
->not->toContain('text-neutral-500')
|
|
|
|
|
->not->toContain('dark:text-neutral-400')
|
|
|
|
|
->toContain('<button')
|
|
|
|
|
->toContain("merge(['type' => 'button'])");
|
|
|
|
|
});
|
2026-08-05 18:28:20 +00:00
|
|
|
|
|
|
|
|
it('uses the branded input focus state for the server filter', function () {
|
|
|
|
|
$navbarView = file_get_contents(resource_path('views/livewire/server/navbar.blade.php'));
|
|
|
|
|
|
|
|
|
|
expect($navbarView)
|
|
|
|
|
->toContain('placeholder="Filter servers…"')
|
|
|
|
|
->toContain('class="input h-7!')
|
|
|
|
|
->toContain('<x-reicon name="check-circle"')
|
|
|
|
|
->not->toContain('<x-reicon name="check"');
|
|
|
|
|
});
|
2026-08-11 09:28:46 +00:00
|
|
|
|
2026-08-13 10:17:16 +00:00
|
|
|
it('lists desktop proxy controls inline and keeps Traefik and refresh in Advanced', function () {
|
2026-08-11 09:28:46 +00:00
|
|
|
$navbar = file_get_contents(resource_path('views/livewire/server/navbar.blade.php'));
|
2026-08-13 10:17:16 +00:00
|
|
|
$overflow = file_get_contents(resource_path('views/components/resource-heading-overflow.blade.php'));
|
|
|
|
|
$advanced = file_get_contents(resource_path('views/components/server/advanced.blade.php'));
|
|
|
|
|
$desktopActions = str($navbar)->after("@teleport('#resource-action-hud-slot')")->before('@endteleport')->toString();
|
2026-08-11 09:28:46 +00:00
|
|
|
|
|
|
|
|
expect($desktopActions)
|
|
|
|
|
->toContain('Restart Proxy')
|
|
|
|
|
->toContain('Stop Proxy')
|
|
|
|
|
->toContain('Start Proxy')
|
2026-08-13 10:17:16 +00:00
|
|
|
->toContain('<x-server.advanced')
|
|
|
|
|
->not->toContain('Traefik Dashboard')
|
|
|
|
|
->not->toContain('Refresh Proxy Status')
|
|
|
|
|
->not->toContain('resource-heading-overflow-separator')
|
2026-08-11 09:28:46 +00:00
|
|
|
->not->toContain('<x-modal-confirmation');
|
2026-08-13 10:17:16 +00:00
|
|
|
|
|
|
|
|
expect(strpos($desktopActions, '<x-server.advanced'))
|
|
|
|
|
->toBeLessThan(strpos($desktopActions, 'id="server-desktop-actions"'));
|
|
|
|
|
|
|
|
|
|
expect($advanced)
|
|
|
|
|
->toContain('Advanced')
|
|
|
|
|
->toContain('name="grid"')
|
|
|
|
|
->toContain('Traefik Dashboard')
|
|
|
|
|
->toContain('name="external-link" class="size-3! opacity-70"')
|
|
|
|
|
->toContain('class="flex size-4 shrink-0 items-center justify-center"')
|
|
|
|
|
->toContain('Refresh Proxy Status');
|
|
|
|
|
|
|
|
|
|
expect($overflow)
|
|
|
|
|
->toContain('Actions')
|
|
|
|
|
->toContain('listbox-panel');
|
2026-08-11 09:28:46 +00:00
|
|
|
});
|