<?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();
});
