fix(status): prevent health badge row height expansion

This commit is contained in:
Andras Bacsai 2026-07-15 20:07:51 +02:00
parent e0f85de3fe
commit 91d97bfad2
2 changed files with 10 additions and 6 deletions

View file

@ -21,7 +21,7 @@
$showUnknownHelper = ! str($status)->startsWith('Proxy') && (str($status)->contains('unknown') || str($healthStatus)->contains('unknown'));
$showUnhealthyHelper = ! str($status)->startsWith('Proxy') && (str($status)->contains('unhealthy') || str($healthStatus)->contains('unhealthy'));
@endphp
<div class="flex items-center gap-1">
<div class="flex items-center gap-1 leading-none">
@if ($lastDeploymentLink)
<x-status-badge as="a" href="{{ $lastDeploymentLink }}" target="_blank" status="{{ $badgeStatus }}" type="success"
title="{{ $title }}" class="cursor-pointer underline" />

View file

@ -59,23 +59,27 @@ public function __construct(public string $status) {}
->not->toContain('<svg');
});
it('renders health warning helpers as badges instead of warning icons', function () {
it('renders health warning helpers without increasing the badge row height', function (string $status, string $expectedText) {
$html = view('components.status.running', [
'status' => 'running:unknown',
'status' => $status,
])->render();
$runningStatus = file_get_contents(resource_path('views/components/status/running.blade.php'));
expect($html)
->toContain('No health check')
->toContain($expectedText)
->toContain('class="flex items-center gap-1 leading-none"')
->toContain('inline-flex h-5 max-w-full items-center gap-1 rounded-sm border')
->not->toContain('<svg');
expect($runningStatus)
->toContain('<x-status-badge')
->toContain('class="flex items-center gap-1"')
->toContain('class="flex items-center gap-1 leading-none"')
->not->toContain('class="px-2"')
->not->toContain('viewBox="0 0 256 256"');
});
})->with([
'unknown health' => ['running:unknown', 'No health check'],
'unhealthy' => ['running:unhealthy', 'Unhealthy'],
]);
it('renders restart counts as warning badges', function () {
$resource = new class