evidence_snapshot_id)->toBe((int) $snapshot->getKey()) ->and($review->sections)->toHaveCount(6) ->and($review->summary['evidence_basis']['snapshot_id'])->toBe((int) $snapshot->getKey()); Finding::factory()->create([ 'tenant_id' => (int) $tenant->getKey(), 'workspace_id' => (int) $tenant->workspace_id, 'severity' => Finding::SEVERITY_CRITICAL, ]); $newSnapshotPayload = app(EvidenceSnapshotService::class)->buildSnapshotPayload($tenant); expect($review->fresh()->evidence_snapshot_id)->toBe((int) $snapshot->getKey()) ->and($review->fresh()->summary['evidence_basis']['snapshot_fingerprint'])->toBe((string) $snapshot->fingerprint) ->and($newSnapshotPayload['fingerprint'])->not->toBe((string) $snapshot->fingerprint); }); it('records completeness and publish blockers when the evidence basis is partial or missing', function (): void { [$user, $tenant] = createUserWithTenant(role: 'owner'); $snapshot = seedTenantReviewEvidence( tenant: $tenant, permissionPayload: [ 'required_count' => 10, 'granted_count' => 7, ], operationRunCount: 0, ); $review = composeTenantReviewForTest($tenant, $user, $snapshot); expect($review->completeness_state)->toBe(TenantReviewCompletenessState::Missing->value) ->and($review->status)->toBe(TenantReviewStatus::Draft->value) ->and($review->publishBlockers())->not->toBeEmpty(); });