TenantAtlas/apps/platform/tests/Unit/Support/TenantConfiguration/Spec415CoverageCaptureOperationRunSummaryTest.php
Ahmed Darrazi 736e61c73e
Some checks failed
PR Fast Feedback / fast-feedback (pull_request) Failing after 1m37s
feat: add generic content-backed coverage capture
2026-06-25 21:55:27 +02:00

30 lines
1.1 KiB
PHP

<?php
declare(strict_types=1);
use App\Services\TenantConfiguration\CoverageCaptureOutcomeSummarizer;
use App\Support\OperationCatalog;
use App\Support\OperationRunOutcome;
it('summarizes capture outcomes with existing canonical operation summary keys', function (): void {
$result = (new CoverageCaptureOutcomeSummarizer)->summarize([
['canonical_type' => 'deviceAndAppManagementAssignmentFilter', 'outcome' => 'captured', 'item_count' => 1],
['canonical_type' => 'roleScopeTag', 'outcome' => 'capture_blocked_beta', 'item_count' => 0],
['canonical_type' => 'notificationMessageTemplate', 'outcome' => 'capture_failed', 'reason_code' => 'graph_response_failed_503'],
]);
expect($result['summary_counts'])->toBe([
'total' => 3,
'processed' => 3,
'succeeded' => 1,
'skipped' => 1,
'failed' => 1,
'errors_recorded' => 1,
])
->and($result['run_outcome'])->toBe(OperationRunOutcome::PartiallySucceeded->value);
foreach (array_keys($result['summary_counts']) as $key) {
expect(OperationCatalog::allowedSummaryKeys())->toContain($key);
}
});