Files
coolify/tests/Feature/ServerIndexViewSwitcherTest.php
T
Andras Bacsai de4e74b4cd feat(server): fall back Sentinel URL to request host
Use the current request scheme/host when no FQDN or public IP is set,
skipping loopback hosts. Polish boarding/server create cards, optional
listbox tooltips, and cover the layout and Sentinel URL behavior in tests.
2026-08-07 15:41:39 +02:00

33 lines
1.5 KiB
PHP

<?php
test('view switchers use the shared coollabs selected state on every page', function () {
$views = collect([
resource_path('views/livewire/server/index.blade.php'),
resource_path('views/livewire/project/index.blade.php'),
resource_path('views/livewire/project/show.blade.php'),
resource_path('views/livewire/project/resource/index.blade.php'),
resource_path('views/livewire/project/service/configuration.blade.php'),
resource_path('views/livewire/tags/show.blade.php'),
])->map(fn (string $path): string => file_get_contents($path));
$utilities = file_get_contents(resource_path('css/utilities.css'));
expect($views->every(fn (string $view): bool => str_contains($view, "viewMode === 'table'")
&& str_contains($view, "viewMode === 'grid'")
&& str_contains($view, 'control-selected')))
->toBeTrue()
->and($views->implode("\n"))->not->toContain('dark:bg-warning/15 dark:text-warning')
->and($utilities)
->toContain('@utility control-selected')
->toContain('@apply bg-coollabs text-white dark:bg-coollabs dark:text-white;');
});
test('server index does not expose server IP addresses', function () {
$view = file_get_contents(resource_path('views/livewire/server/index.blade.php'));
expect($view)
->not->toContain("'address' => \$server->ip")
->not->toContain('<div>Address</div>')
->not->toContain('x-text="server.address"')
->not->toContain('server.address,');
});