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.
This commit is contained in:
Andras Bacsai
2026-09-08 12:53:57 +02:00
parent ff24e82fd2
commit 0615c784ac
2 changed files with 12 additions and 4 deletions
@@ -262,10 +262,6 @@
@elseif ($server->isSentinelEnabled())
<x-application.settings-section id="server-metrics-overview-section" title="Metrics"
helper="Inspect recent CPU and memory usage reported by Sentinel.">
<x-slot:actions>
<x-status-badge status="Disabled" type="neutral" />
</x-slot:actions>
<x-empty size="sm" title="Metrics are disabled"
description="Enable metrics to begin collecting CPU and memory history for this server."
icon-name="dashboard">
@@ -8,3 +8,15 @@ test('sentinel-required metrics state does not repeat an unavailable badge', fun
->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"');
});