TenantAtlas/tests/Unit/DefaultPolicyNormalizerDiffTest.php
Ahmed Darrazi de199ef476 fix(tests): remove per-file TestCase uses
Pest v4 discovery fails when unit tests re-bind the test case with uses(TestCase::class). Remove per-file bindings and keep RefreshDatabase where needed. Also update RunBackupScheduleJobTest to pass BulkOperationService when calling handle() manually.
2026-01-08 01:38:54 +01:00

20 lines
625 B
PHP

<?php
use App\Services\Intune\DefaultPolicyNormalizer;
it('flattens normalized settings with section prefixes for diffs', function () {
$normalizer = app(DefaultPolicyNormalizer::class);
$snapshot = [
'@odata.type' => '#microsoft.graph.somePolicy',
'displayName' => 'Example Policy',
'customSetting' => true,
];
$flat = $normalizer->flattenForDiff($snapshot, 'somePolicyType', 'all');
expect($flat)->toHaveKey('General > Display Name', 'Example Policy');
expect($flat)->toHaveKey('General > Custom Setting');
expect($flat['General > Custom Setting'])->toBeTrue();
});