active()->create([ 'workspace_id' => (int) $tenant->workspace_id, ]); $complete = BaselineSnapshot::factory()->create([ 'workspace_id' => (int) $tenant->workspace_id, 'baseline_profile_id' => (int) $profile->getKey(), 'captured_at' => now()->subHour(), 'summary_jsonb' => [ 'total_items' => 5, 'fidelity_counts' => ['content' => 5, 'meta' => 0], 'gaps' => ['count' => 0, 'by_reason' => []], ], ]); $withGaps = BaselineSnapshot::factory()->create([ 'workspace_id' => (int) $tenant->workspace_id, 'baseline_profile_id' => (int) $profile->getKey(), 'captured_at' => now()->subMinutes(10), 'summary_jsonb' => [ 'total_items' => 5, 'fidelity_counts' => ['content' => 3, 'meta' => 2], 'gaps' => ['count' => 2, 'by_reason' => ['meta_fallback' => 2]], ], ]); $this->actingAs($user) ->get(BaselineSnapshotResource::getUrl(panel: 'admin')) ->assertOk() ->assertSee('Complete') ->assertSee('Captured with gaps') ->assertSee('Content 5, Meta 0') ->assertSee('Content 3, Meta 2'); $this->actingAs($user) ->get(BaselineSnapshotResource::getUrl('view', ['record' => $withGaps], panel: 'admin')) ->assertOk() ->assertSee('Coverage summary') ->assertSee('Captured with gaps') ->assertSee('Content 3, Meta 2') ->assertSee('Evidence gaps') ->assertSee('2'); $this->actingAs($user) ->get(BaselineSnapshotResource::getUrl('view', ['record' => $complete], panel: 'admin')) ->assertOk() ->assertSee('Coverage summary') ->assertSee('Complete') ->assertSee('Content 5, Meta 0') ->assertSee('Evidence gaps') ->assertSee('0'); });