coolify/tests/Feature/ServerMetricsEmptyStateTest.php
Andras Bacsai 0615c784ac fix(server): remove duplicate Disabled badge from metrics empty state
The metrics-disabled empty state already titles itself "Metrics are disabled", so the extra status badge was redundant. Cover the Sentinel-enabled branch so that badge does not return.
2026-09-08 12:53:57 +02:00

22 lines
851 B
PHP

<?php
test('sentinel-required metrics state does not repeat an unavailable badge', function () {
$view = file_get_contents(resource_path('views/livewire/server/charts.blade.php'));
$sentinelRequiredState = str($view)->after('@else')->before('@endif')->toString();
expect($sentinelRequiredState)
->toContain('title="Sentinel is required"')
->not->toContain('status="Unavailable"');
});
test('disabled metrics state does not repeat a disabled badge', function () {
$view = file_get_contents(resource_path('views/livewire/server/charts.blade.php'));
$disabledState = str($view)
->after('@elseif ($server->isSentinelEnabled())')
->before('@else')
->toString();
expect($disabledState)
->toContain('title="Metrics are disabled"')
->not->toContain('status="Disabled"');
});