TenantAtlas/apps/platform/tests/Unit/Support/TenantConfiguration/Spec422ExchangeTeamsRenderableSummaryTest.php
Ahmed Darrazi 4c1e14c6bc
Some checks failed
PR Fast Feedback / fast-feedback (pull_request) Failing after 6m9s
feat: complete spec 422 exchange teams comparable renderable pack
2026-06-30 06:18:15 +02:00

48 lines
1.8 KiB
PHP

<?php
declare(strict_types=1);
use App\Services\TenantConfiguration\ExchangeTeamsRenderableSummaryBuilder;
it('Spec422 renders operator-safe Exchange and Teams summaries without raw payload dependency', function (string $canonicalType, array $payload, string $resourceType, string $expectedText): void {
$summary = app(ExchangeTeamsRenderableSummaryBuilder::class)->build($canonicalType, $payload, [
'claim_state' => 'internal_only',
'identity_state' => 'stable',
'last_captured' => 'Jun 28, 2026 10:00 AM',
]);
$encoded = json_encode($summary, JSON_THROW_ON_ERROR);
expect($summary)->not->toBeNull()
->and($summary['resource_type'])->toBe($resourceType)
->and($encoded)->toContain($expectedText)
->and($encoded)->toContain('internal_only')
->and($encoded)->not->toContain('raw_payload')
->and($encoded)->not->toContain('source_endpoint')
->and($encoded)->not->toContain('planner-app');
})->with([
'transport rule' => [
'transportRule',
['DisplayName' => 'Rule', 'Enabled' => true, 'Actions' => ['RedirectMessageTo' => ['security@example.com']]],
'Transport rule',
'security@example.com',
],
'accepted domain' => [
'acceptedDomain',
['DomainName' => 'contoso.com', 'DomainType' => 'Authoritative', 'IsDefault' => true],
'Accepted domain',
'contoso.com',
],
'app permission policy' => [
'appPermissionPolicy',
['DisplayName' => 'Policy', 'AllowAppList' => [['DisplayName' => 'Planner', 'AppId' => 'planner-app']]],
'Teams app permission policy',
'Planner',
],
'meeting policy' => [
'meetingPolicy',
['DisplayName' => 'Meeting', 'AllowTranscription' => true],
'Teams meeting policy',
'Allow Transcription',
],
]);