TenantAtlas/tests/Feature/Support/Diff/SharedDiffSummaryPartialTest.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

50 lines
1.4 KiB
PHP

<?php
declare(strict_types=1);
use App\Support\Diff\DiffSummary;
it('renders all shared summary badge counts with centralized state labels', function (): void {
$this->view('filament.partials.diff.summary-badges', [
'summary' => new DiffSummary(
changedCount: 2,
addedCount: 1,
removedCount: 3,
unchangedCount: 4,
),
])
->assertSee('2 changed')
->assertSee('1 added')
->assertSee('3 removed')
->assertSee('4 unchanged')
->assertSee('fi-badge');
});
it('renders a clear fallback when no diff rows are available', function (): void {
$this->view('filament.partials.diff.summary-badges', [
'summary' => null,
])
->assertSee('0 changed')
->assertSee('0 added')
->assertSee('0 removed')
->assertSee('0 unchanged')
->assertSee('No diff data available.');
});
it('renders summary counts from array payloads and preserves explicit no-change messaging', function (): void {
$this->view('filament.partials.diff.summary-badges', [
'summary' => [
'changed' => 0,
'added' => 0,
'removed' => 0,
'unchanged' => 4,
'message' => 'No changes detected.',
],
])
->assertSee('0 changed')
->assertSee('0 added')
->assertSee('0 removed')
->assertSee('4 unchanged')
->assertSee('No changes detected.');
});