mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-14 16:52:45 -04:00
- Delete Blade components, component classes, Livewire components and views that nothing uses after the redesign. - Delete tests that only compare Blade/CSS source text; keep the source checks for authorization gates, stable wire:key values and escaping. - Update stale tests to the current UI and behaviour. - Update DESIGN.md to the current navigation and layout. - Add a lesson: test behaviour, not source markup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
27 lines
1.4 KiB
PHP
27 lines
1.4 KiB
PHP
<?php
|
|
|
|
use App\Models\Application;
|
|
|
|
it('stores nullable application container presence as a boolean', function () {
|
|
$application = new Application;
|
|
$application->forceFill(['container_present' => 1]);
|
|
$migration = file_get_contents(base_path('database/migrations/2026_08_30_193506_add_container_present_to_applications_table.php'));
|
|
|
|
expect($application->container_present)->toBeTrue()
|
|
->and($migration)->toContain("boolean('container_present')->nullable()");
|
|
});
|
|
|
|
it('updates container presence at application lifecycle boundaries', function () {
|
|
$stopAction = file_get_contents(app_path('Actions/Application/StopApplication.php'));
|
|
$dockerStatus = file_get_contents(app_path('Actions/Docker/GetContainersStatus.php'));
|
|
$sentinelStatus = file_get_contents(app_path('Jobs/PushServerUpdateJob.php'));
|
|
|
|
expect($stopAction)->toContain('$containerPresent = ! $removeContainers;')
|
|
->and($stopAction)->toMatch('/if \(\$server->isSwarm\(\)\).*?\$containerPresent = false;.*?docker stack rm/s')
|
|
->and($stopAction)->toContain("'container_present' => \$containerPresent")
|
|
->and($dockerStatus)->toContain("'container_present' => true")
|
|
->and($dockerStatus)->toContain("'container_present' => false")
|
|
->and($sentinelStatus)->toContain("'container_present' => true")
|
|
->and($sentinelStatus)->toContain("'container_present' => false");
|
|
});
|