TenantAtlas/apps/platform/tests/Feature/Badges/OnboardingBadgeSemanticsTest.php
2026-04-08 09:33:16 +02:00

27 lines
1011 B
PHP

<?php
use App\Support\Badges\BadgeCatalog;
use App\Support\Badges\BadgeDomain;
it('maps onboarding verification status blocked to a Blocked danger badge', function (): void {
$spec = BadgeCatalog::spec(BadgeDomain::ManagedTenantOnboardingVerificationStatus, 'blocked');
expect($spec->label)->toBe('Blocked');
expect($spec->color)->toBe('danger');
expect($spec->icon)->toBe('heroicon-m-x-circle');
});
it('maps onboarding verification status ready to a Ready success badge', function (): void {
$spec = BadgeCatalog::spec(BadgeDomain::ManagedTenantOnboardingVerificationStatus, 'ready');
expect($spec->label)->toBe('Ready');
expect($spec->color)->toBe('success');
expect($spec->icon)->toBe('heroicon-m-check-circle');
});
it('normalizes onboarding verification status input before mapping', function (): void {
$spec = BadgeCatalog::spec(BadgeDomain::ManagedTenantOnboardingVerificationStatus, 'NEEDS ATTENTION');
expect($spec->label)->toBe('Needs attention');
});