fix(status): prevent health badge row height expansion
This commit is contained in:
parent
e0f85de3fe
commit
91d97bfad2
2 changed files with 10 additions and 6 deletions
|
|
@ -21,7 +21,7 @@
|
||||||
$showUnknownHelper = ! str($status)->startsWith('Proxy') && (str($status)->contains('unknown') || str($healthStatus)->contains('unknown'));
|
$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'));
|
$showUnhealthyHelper = ! str($status)->startsWith('Proxy') && (str($status)->contains('unhealthy') || str($healthStatus)->contains('unhealthy'));
|
||||||
@endphp
|
@endphp
|
||||||
<div class="flex items-center gap-1">
|
<div class="flex items-center gap-1 leading-none">
|
||||||
@if ($lastDeploymentLink)
|
@if ($lastDeploymentLink)
|
||||||
<x-status-badge as="a" href="{{ $lastDeploymentLink }}" target="_blank" status="{{ $badgeStatus }}" type="success"
|
<x-status-badge as="a" href="{{ $lastDeploymentLink }}" target="_blank" status="{{ $badgeStatus }}" type="success"
|
||||||
title="{{ $title }}" class="cursor-pointer underline" />
|
title="{{ $title }}" class="cursor-pointer underline" />
|
||||||
|
|
|
||||||
|
|
@ -59,23 +59,27 @@ public function __construct(public string $status) {}
|
||||||
->not->toContain('<svg');
|
->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', [
|
$html = view('components.status.running', [
|
||||||
'status' => 'running:unknown',
|
'status' => $status,
|
||||||
])->render();
|
])->render();
|
||||||
$runningStatus = file_get_contents(resource_path('views/components/status/running.blade.php'));
|
$runningStatus = file_get_contents(resource_path('views/components/status/running.blade.php'));
|
||||||
|
|
||||||
expect($html)
|
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')
|
->toContain('inline-flex h-5 max-w-full items-center gap-1 rounded-sm border')
|
||||||
->not->toContain('<svg');
|
->not->toContain('<svg');
|
||||||
|
|
||||||
expect($runningStatus)
|
expect($runningStatus)
|
||||||
->toContain('<x-status-badge')
|
->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('class="px-2"')
|
||||||
->not->toContain('viewBox="0 0 256 256"');
|
->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 () {
|
it('renders restart counts as warning badges', function () {
|
||||||
$resource = new class
|
$resource = new class
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue