TenantAtlas/apps/platform/tests/Unit/Badges/VerificationBadgesTest.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

69 lines
2.7 KiB
PHP

<?php
declare(strict_types=1);
use App\Support\Badges\BadgeCatalog;
use App\Support\Badges\BadgeDomain;
it('maps verification check status values to canonical badge semantics', function (): void {
$pass = BadgeCatalog::spec(BadgeDomain::VerificationCheckStatus, 'pass');
expect($pass->label)->toBe('Pass');
expect($pass->color)->toBe('success');
$fail = BadgeCatalog::spec(BadgeDomain::VerificationCheckStatus, 'fail');
expect($fail->label)->toBe('Fail');
expect($fail->color)->toBe('danger');
$warn = BadgeCatalog::spec(BadgeDomain::VerificationCheckStatus, 'warn');
expect($warn->label)->toBe('Warn');
expect($warn->color)->toBe('warning');
$skip = BadgeCatalog::spec(BadgeDomain::VerificationCheckStatus, 'skip');
expect($skip->label)->toBe('Skipped');
expect($skip->color)->toBe('gray');
$running = BadgeCatalog::spec(BadgeDomain::VerificationCheckStatus, 'running');
expect($running->label)->toBe('Running');
expect($running->color)->toBe('info');
});
it('maps verification check severity values to canonical badge semantics', function (): void {
$info = BadgeCatalog::spec(BadgeDomain::VerificationCheckSeverity, 'info');
expect($info->label)->toBe('Info');
expect($info->color)->toBe('gray');
$low = BadgeCatalog::spec(BadgeDomain::VerificationCheckSeverity, 'low');
expect($low->label)->toBe('Low');
expect($low->color)->toBe('info');
$medium = BadgeCatalog::spec(BadgeDomain::VerificationCheckSeverity, 'medium');
expect($medium->label)->toBe('Medium');
expect($medium->color)->toBe('warning');
$high = BadgeCatalog::spec(BadgeDomain::VerificationCheckSeverity, 'high');
expect($high->label)->toBe('High');
expect($high->color)->toBe('danger');
$critical = BadgeCatalog::spec(BadgeDomain::VerificationCheckSeverity, 'critical');
expect($critical->label)->toBe('Critical');
expect($critical->color)->toBe('danger');
});
it('maps verification report overall values to canonical badge semantics', function (): void {
$ready = BadgeCatalog::spec(BadgeDomain::VerificationReportOverall, 'ready');
expect($ready->label)->toBe('Ready');
expect($ready->color)->toBe('success');
$needsAttention = BadgeCatalog::spec(BadgeDomain::VerificationReportOverall, 'needs_attention');
expect($needsAttention->label)->toBe('Needs attention');
expect($needsAttention->color)->toBe('warning');
$blocked = BadgeCatalog::spec(BadgeDomain::VerificationReportOverall, 'blocked');
expect($blocked->label)->toBe('Blocked');
expect($blocked->color)->toBe('danger');
$running = BadgeCatalog::spec(BadgeDomain::VerificationReportOverall, 'running');
expect($running->label)->toBe('Running');
expect($running->color)->toBe('info');
});