Add fail-hard Graph guard tests for Backup Sets index + Restore wizard create, and refactor restore group mapping to be DB-only with masked fallback labels.
35 lines
970 B
PHP
35 lines
970 B
PHP
<?php
|
|
|
|
use App\Filament\Resources\BackupSetResource;
|
|
use App\Models\BackupSet;
|
|
use App\Models\Tenant;
|
|
|
|
test('backup sets index renders without touching graph', function () {
|
|
$tenant = Tenant::factory()->create();
|
|
$otherTenant = Tenant::factory()->create();
|
|
|
|
[$user] = createUserWithTenant($tenant);
|
|
$user->tenants()->syncWithoutDetaching([
|
|
$otherTenant->getKey() => ['role' => 'owner'],
|
|
]);
|
|
|
|
$visibleSet = BackupSet::factory()->create([
|
|
'tenant_id' => $tenant->getKey(),
|
|
'name' => 'visible-backup-set',
|
|
]);
|
|
|
|
$hiddenSet = BackupSet::factory()->create([
|
|
'tenant_id' => $otherTenant->getKey(),
|
|
'name' => 'hidden-backup-set',
|
|
]);
|
|
|
|
bindFailHardGraphClient();
|
|
|
|
$this->actingAs($user)
|
|
->get(BackupSetResource::getUrl('index', tenant: $tenant))
|
|
->assertOk()
|
|
->assertSee('Created by')
|
|
->assertSee($visibleSet->name)
|
|
->assertDontSee($hiddenSet->name);
|
|
});
|