fix: handle complete empty snapshots and match dropdown trigger width

This commit is contained in:
Andras Bacsai committed 2026-08-16 18:26:40 +02:00
1 parent 9729e765b4
commit e28d8ca0ff
4 files changed
+23 -21

No files matched your search

@@ -77,7 +77,7 @@ test('database status is updated when container status changes', function () {
expect($database->status)->toBe('running:healthy');
});
test('database is not marked exited when containers list is empty', function () {
test('database is not marked exited when an incomplete containers snapshot is empty', function () {
$team = Team::factory()->create();
$database = createPushUpdatePostgresql($team, [
'status' => 'running:healthy',
@@ -88,6 +88,7 @@ test('database is not marked exited when containers list is empty', function ()
// Empty containers = Sentinel might have failed, should NOT mark as exited
$data = [
'containers' => [],
'snapshot' => ['complete' => false],
];
$job = new PushServerUpdateJob($server, $data);
@@ -99,6 +100,22 @@ test('database is not marked exited when containers list is empty', function ()
expect($database->status)->toBe('running:healthy');
});
test('database is marked exited when a complete containers snapshot is empty', function () {
$team = Team::factory()->create();
$database = createPushUpdatePostgresql($team, [
'status' => 'running:healthy',
]);
$data = [
'containers' => [],
'snapshot' => ['complete' => true],
];
(new PushServerUpdateJob($database->destination->server, $data))->handle();
expect($database->refresh()->status)->toBe('exited:unhealthy');
});
function createPushUpdatePostgresql(Team $team, array $attributes = []): StandalonePostgresql
{
$lastOnlineAt = $attributes['last_online_at'] ?? null;