TenantAtlas/apps/platform/tests/Unit/Support/TenantConfiguration/Spec415CoverageCaptureOperationRunSummaryTest.php
ahmido ca0f54614d feat: add generic content-backed coverage capture (#482)
Automated PR provided by Codex via Gitea API.

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #482
2026-06-25 19:55:52 +00: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);
}
});