<?php

declare(strict_types=1);

use App\Support\Diff\ValueStringifier;

it('formats RBAC diff values for null booleans scalars empty lists and compact structures consistently', function (): void {
    $stringifier = new ValueStringifier;

    expect($stringifier->stringify(null))->toBe('—')
        ->and($stringifier->stringify(true))->toBe('Enabled')
        ->and($stringifier->stringify(false))->toBe('Disabled')
        ->and($stringifier->stringify('TenantPilot'))->toBe('TenantPilot')
        ->and($stringifier->stringify(''))->toBe('""')
        ->and($stringifier->stringify(0))->toBe('0')
        ->and($stringifier->stringify(42))->toBe('42')
        ->and($stringifier->stringify([]))->toBe('[]')
        ->and($stringifier->stringify(['Alpha', 'Beta']))->toBe('Alpha, Beta')
        ->and($stringifier->stringify(['Scope tag 1', null]))->toBe('Scope tag 1, —')
        ->and($stringifier->stringify(['label' => 'Primary', 'enabled' => true]))->toBe('{"label":"Primary","enabled":true}');
});
