TenantAtlas/apps/platform/tests/Feature/Filament/WorkspaceOverviewContentTest.php
ahmido 53e799fea7 Spec 185: workspace recovery posture visibility (#216)
## Summary
- add Spec 185 workspace recovery posture visibility artifacts under `specs/185-workspace-recovery-posture-visibility`
- promote tenant backup health and recovery evidence onto the workspace overview with separate metrics, attention ordering, calmness coverage, and tenant-dashboard drill-throughs
- batch visible-tenant backup/recovery derivation to keep the workspace overview query-bounded
- align follow-up fixes from the authoritative suite rerun, including dashboard truth-alignment fixtures, canonical backup schedule tenant context, guard-path cleanup, smoke-fixture credential removal, and robust theme asset manifest handling

## Testing
- `cd apps/platform && ./vendor/bin/sail bin pint --dirty --format agent`
- `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Unit/Filament/PanelThemeAssetTest.php tests/Feature/Guards/DerivedStateConsumerAdoptionGuardTest.php`
- focused regression pack for the previously failing cases passed
- full suite JUnit run passed: `3401` tests, `18849` assertions, `0` failures, `0` errors, `8` skips

## Notes
- no new schema or persisted workspace recovery model
- no provider-registration changes; Filament/Livewire stack remains on Filament v5 and Livewire v4
- no new destructive actions or global search changes

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #216
2026-04-09 12:57:19 +00:00

49 lines
2.0 KiB
PHP

<?php
declare(strict_types=1);
use App\Models\OperationRun;
use App\Support\OperationRunStatus;
use App\Support\Workspaces\WorkspaceContext;
it('shows workspace identity, summary cards, recent operations, and quick actions', function (): void {
[$user, $tenant] = createUserWithTenant(role: 'owner');
workspaceOverviewSeedQuietTenantTruth($tenant);
$backupSet = workspaceOverviewSeedHealthyBackup($tenant, [
'completed_at' => now()->subMinutes(10),
]);
workspaceOverviewSeedRestoreHistory($tenant, $backupSet, 'completed');
OperationRun::factory()->create([
'tenant_id' => (int) $tenant->getKey(),
'workspace_id' => (int) $tenant->workspace_id,
'type' => 'inventory_sync',
'status' => OperationRunStatus::Running->value,
'outcome' => 'pending',
]);
$this->actingAs($user)
->withSession([WorkspaceContext::SESSION_KEY => (int) $tenant->workspace_id])
->get('/admin')
->assertOk()
->assertSee('Workspace overview')
->assertSee('Accessible tenants')
->assertSee('Governance attention')
->assertSee('Backup attention')
->assertSee('Recovery attention')
->assertSee('Active operations')
->assertSee('Needs attention')
->assertSee('Recent operations')
->assertSee('Choose tenant')
->assertSee('Open operations')
->assertSee('Open alerts')
->assertSee('Review current and recent workspace-wide operations.')
->assertSee('Activity only. Active execution does not imply governance health.')
->assertSee('Visible tenants with non-healthy backup posture.')
->assertSee('Visible tenants with weakened or unvalidated recovery evidence.')
->assertSee('Governance risk counts affected tenants')
->assertSee('Backup health stays separate from recovery evidence')
->assertSee('Calm wording stays bounded to visible tenants and checked domains')
->assertSee('Inventory sync');
});