TenantAtlas/apps/platform/tests/Unit/Support/TenantConfiguration/Spec422ExchangeTeamsRenderableSummaryTest.php
ahmido 13d363c8b8 feat: complete spec 422 exchange teams comparable renderable pack (#489)
## Summary

This PR completes spec 422 exchange teams comparable renderable pack with comparable diffing, renderable summary builders, and comprehensive test updates.

## Commit
- 4c1e14c6 feat: complete spec 422 exchange teams comparable renderable pack

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #489
2026-06-30 04:20:13 +00: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',
],
]);