TenantAtlas/apps/platform/tests/Feature/RestoreRunArchiveGuardTest.php
ahmido 38523814c2 fix: restore full-suite green signals across platform workflows (#351)
## Summary
- restore broad full-suite green-signal coverage across platform governance, operations, onboarding, dashboard/productization, and customer review flows
- align related platform tests and supporting behavior with the current expected state for this restoration pass
- update the spec-candidates queue as part of the same suite-restoration sweep

## Validation
- `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Browser/Dashboard/TenantDashboardProductizationSmokeTest.php tests/Browser/Reviews/CustomerReviewWorkspaceSmokeTest.php tests/Browser/Spec194GovernanceFrictionSmokeTest.php tests/Browser/Spec265DecisionRegisterSmokeTest.php`

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #351
2026-05-12 18:50:40 +00:00

40 lines
1.1 KiB
PHP

<?php
use App\Filament\Resources\RestoreRunResource\Pages\ListRestoreRuns;
use App\Models\BackupSet;
use App\Models\RestoreRun;
use App\Models\ManagedEnvironment;
use App\Models\User;
use Filament\Facades\Filament;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Livewire\Livewire;
uses(RefreshDatabase::class);
test('restore run archive action does not archive non-deletable runs', function () {
$tenant = ManagedEnvironment::factory()->create();
$backupSet = BackupSet::create([
'managed_environment_id' => $tenant->id,
'name' => 'Set RR',
'status' => 'completed',
'item_count' => 0,
]);
$running = RestoreRun::create([
'managed_environment_id' => $tenant->id,
'backup_set_id' => $backupSet->id,
'status' => 'running',
'is_dry_run' => true,
]);
[$user, $tenant] = createUserWithTenant(tenant: $tenant, role: 'owner');
setAdminPanelContext($tenant);
Livewire::actingAs($user)
->test(ListRestoreRuns::class)
->callTableAction('archive', $running);
expect(RestoreRun::withTrashed()->find($running->id)?->trashed())->toBeFalse();
});