wowowowowo
This commit is contained in:
@@ -9,6 +9,7 @@ use App\Models\Provider;
|
||||
use App\Models\Server;
|
||||
use App\Models\Service;
|
||||
use App\Models\User;
|
||||
use App\Services\Operations\RemoteCommandRunner;
|
||||
use Inertia\Testing\AssertableInertia;
|
||||
|
||||
it('shows the stateful service update page with backup capability', function () {
|
||||
@@ -43,6 +44,7 @@ it('stores an explicit stateful update operation', function () {
|
||||
]), [
|
||||
'image_digest' => 'sha256:newdigest',
|
||||
'backup_requested' => true,
|
||||
'confirmation' => 'postgres',
|
||||
]);
|
||||
|
||||
$response->assertRedirect(route('servers.show', [
|
||||
@@ -58,6 +60,26 @@ it('stores an explicit stateful update operation', function () {
|
||||
->and($service->update_status)->toBe('update_pending');
|
||||
});
|
||||
|
||||
it('resolves the latest service image digest from the update page', function () {
|
||||
app()->instance(RemoteCommandRunner::class, new class implements RemoteCommandRunner
|
||||
{
|
||||
public function run(Server $server, string $script): string
|
||||
{
|
||||
return "image_digest=postgres:18@sha256:resolveddigest\n";
|
||||
}
|
||||
});
|
||||
|
||||
[$user, $organisation, $server, $service] = serviceUpdateFixture([
|
||||
'backup_enabled' => true,
|
||||
]);
|
||||
|
||||
$this->actingAs($user)
|
||||
->post(route('service-updates.resolve', [$organisation, $server, $service]))
|
||||
->assertRedirect(route('service-updates.create', [$organisation, $server, $service]));
|
||||
|
||||
expect($service->refresh()->available_image_digest)->toBe('sha256:resolveddigest');
|
||||
});
|
||||
|
||||
/**
|
||||
* @return array{0: User, 1: Organisation, 2: Server, 3: Service}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user