TenantAtlas/apps/platform/tests/Unit/Findings/FindingExceptionBadgeTest.php
ahmido ce0615a9c1 Spec 182: relocate Laravel platform to apps/platform (#213)
## Summary
- move the Laravel application into `apps/platform` and keep the repository root for orchestration, docs, and tooling
- update the local command model, Sail/Docker wiring, runtime paths, and ignore rules around the new platform location
- add relocation quickstart/contracts plus focused smoke coverage for bootstrap, command model, routes, and runtime behavior

## Validation
- `cd apps/platform && ./vendor/bin/sail artisan test --compact tests/Feature/PlatformRelocation`
- integrated browser smoke validated `/up`, `/`, `/admin`, `/admin/choose-workspace`, and tenant route semantics for `200`, `403`, and `404`

## Remaining Rollout Checks
- validate Dokploy build context and working-directory assumptions against the new `apps/platform` layout
- confirm web, queue, and scheduler processes all start from the expected working directory in staging/production
- verify no legacy volume mounts or asset-publish paths still point at the old root-level `public/` or `storage/` locations

Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de>
Reviewed-on: #213
2026-04-08 08:40:47 +00:00

44 lines
2.0 KiB
PHP

<?php
declare(strict_types=1);
use App\Models\FindingException;
use App\Support\Badges\BadgeCatalog;
use App\Support\Badges\BadgeDomain;
it('maps finding exception lifecycle states to canonical badge semantics', function (): void {
$pending = BadgeCatalog::spec(BadgeDomain::FindingExceptionStatus, FindingException::STATUS_PENDING);
expect($pending->label)->toBe('Pending')
->and($pending->color)->toBe('warning');
$expiring = BadgeCatalog::spec(BadgeDomain::FindingExceptionStatus, FindingException::STATUS_EXPIRING);
expect($expiring->label)->toBe('Expiring')
->and($expiring->color)->toBe('warning');
$expired = BadgeCatalog::spec(BadgeDomain::FindingExceptionStatus, FindingException::STATUS_EXPIRED);
expect($expired->label)->toBe('Expired')
->and($expired->color)->toBe('danger');
$revoked = BadgeCatalog::spec(BadgeDomain::FindingExceptionStatus, FindingException::STATUS_REVOKED);
expect($revoked->label)->toBe('Revoked')
->and($revoked->color)->toBe('danger');
});
it('maps governance validity states to canonical badge semantics', function (): void {
$valid = BadgeCatalog::spec(BadgeDomain::FindingRiskGovernanceValidity, FindingException::VALIDITY_VALID);
expect($valid->label)->toBe('Valid')
->and($valid->color)->toBe('success');
$expiring = BadgeCatalog::spec(BadgeDomain::FindingRiskGovernanceValidity, FindingException::VALIDITY_EXPIRING);
expect($expiring->label)->toBe('Expiring')
->and($expiring->color)->toBe('warning');
$expired = BadgeCatalog::spec(BadgeDomain::FindingRiskGovernanceValidity, FindingException::VALIDITY_EXPIRED);
expect($expired->label)->toBe('Expired')
->and($expired->color)->toBe('danger');
$missingSupport = BadgeCatalog::spec(BadgeDomain::FindingRiskGovernanceValidity, FindingException::VALIDITY_MISSING_SUPPORT);
expect($missingSupport->label)->toBe('Missing support')
->and($missingSupport->color)->toBe('danger');
});