TenantAtlas/tests/Unit/Support/Diff/ValueStringifierTest.php
ahmido 3f6f80f7af feat: refine onboarding draft flow and RBAC diff UX (#171)
## Summary
- add the RBAC role definition diff UX upgrade as the first concrete consumer of the shared diff presentation foundation
- refine managed tenant onboarding draft routing, CTA labeling, and cancellation redirect behavior
- tighten related Filament and diff rendering regression coverage

## Testing
- updated focused Pest coverage for onboarding draft routing and lifecycle behavior
- updated focused Pest coverage for shared diff partials and RBAC finding rendering

## Notes
- Livewire v4.0+ compliance is preserved within the existing Filament v5 surfaces
- provider registration remains unchanged in bootstrap/providers.php
- no new Filament assets were added; existing deployment practice still relies on php artisan filament:assets when assets change

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #171
2026-03-14 20:09:54 +00:00

22 lines
1012 B
PHP

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