## Summary - harden findings and finding-exception Filament surfaces so workflow state, governance validity, overdue urgency, and next action are operator-first - add tenant stats widgets, segmented tabs, richer governance warnings, and baseline/dashboard attention propagation for overdue and lapsed governance states - add Spec 166 artifacts plus regression coverage for findings, badges, baseline summaries, tenantless operation viewer behavior, and critical table standards ## Verification - `vendor/bin/sail bin pint --dirty --format agent` - `vendor/bin/sail artisan test --compact` ## Filament Notes - Livewire v4.0+ compliance: yes, implementation stays on Filament v5 / Livewire v4 APIs only - Provider registration: unchanged, Laravel 12 panel/provider registration remains in `bootstrap/providers.php` - Global search: unchanged in this slice; `FindingExceptionResource` stays not globally searchable, no new globally searchable resource was introduced - Destructive actions: existing revoke/reject/approve/renew/workflow mutations remain capability-gated and confirmation-gated where already defined - Asset strategy: no new assets added; existing deploy process remains unchanged, including `php artisan filament:assets` when registered assets are used - Testing plan delivered: findings list/detail, exception register, dashboard attention, baseline summary, badge semantics, and tenantless operation viewer coverage Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #197
75 lines
3.0 KiB
PHP
75 lines
3.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Support\Badges\BadgeCatalog;
|
|
use App\Support\Badges\BadgeDomain;
|
|
|
|
it('maps finding severity values to canonical badge semantics', function (): void {
|
|
$low = BadgeCatalog::spec(BadgeDomain::FindingSeverity, 'low');
|
|
expect($low->label)->toBe('Low');
|
|
expect($low->color)->toBe('gray');
|
|
|
|
$medium = BadgeCatalog::spec(BadgeDomain::FindingSeverity, 'medium');
|
|
expect($medium->label)->toBe('Medium');
|
|
expect($medium->color)->toBe('warning');
|
|
|
|
$high = BadgeCatalog::spec(BadgeDomain::FindingSeverity, 'high');
|
|
expect($high->label)->toBe('High');
|
|
expect($high->color)->toBe('danger');
|
|
|
|
$critical = BadgeCatalog::spec(BadgeDomain::FindingSeverity, 'critical');
|
|
expect($critical->label)->toBe('Critical');
|
|
expect($critical->color)->toBe('danger');
|
|
});
|
|
|
|
it('maps finding status values to canonical badge semantics', function (): void {
|
|
$new = BadgeCatalog::spec(BadgeDomain::FindingStatus, 'new');
|
|
expect($new->label)->toBe('New');
|
|
expect($new->color)->toBe('warning');
|
|
|
|
$triaged = BadgeCatalog::spec(BadgeDomain::FindingStatus, 'triaged');
|
|
expect($triaged->label)->toBe('Triaged');
|
|
expect($triaged->color)->toBe('gray');
|
|
|
|
$legacyAcknowledged = BadgeCatalog::spec(BadgeDomain::FindingStatus, 'acknowledged');
|
|
expect($legacyAcknowledged->label)->toBe('Triaged');
|
|
expect($legacyAcknowledged->color)->toBe('gray');
|
|
|
|
$inProgress = BadgeCatalog::spec(BadgeDomain::FindingStatus, 'in_progress');
|
|
expect($inProgress->label)->toBe('In progress');
|
|
expect($inProgress->color)->toBe('info');
|
|
|
|
$reopened = BadgeCatalog::spec(BadgeDomain::FindingStatus, 'reopened');
|
|
expect($reopened->label)->toBe('Reopened');
|
|
expect($reopened->color)->toBe('danger');
|
|
|
|
$resolved = BadgeCatalog::spec(BadgeDomain::FindingStatus, 'resolved');
|
|
expect($resolved->label)->toBe('Resolved');
|
|
expect($resolved->color)->toBe('gray');
|
|
|
|
$closed = BadgeCatalog::spec(BadgeDomain::FindingStatus, 'closed');
|
|
expect($closed->label)->toBe('Closed');
|
|
|
|
$riskAccepted = BadgeCatalog::spec(BadgeDomain::FindingStatus, 'risk_accepted');
|
|
expect($riskAccepted->label)->toBe('Risk accepted');
|
|
});
|
|
|
|
it('maps finding governance validity values to operator-facing attention colors', function (): void {
|
|
$valid = BadgeCatalog::spec(BadgeDomain::FindingRiskGovernanceValidity, 'valid');
|
|
expect($valid->label)->toBe('Valid');
|
|
expect($valid->color)->toBe('success');
|
|
|
|
$expiring = BadgeCatalog::spec(BadgeDomain::FindingRiskGovernanceValidity, 'expiring');
|
|
expect($expiring->label)->toBe('Expiring');
|
|
expect($expiring->color)->toBe('warning');
|
|
|
|
$rejected = BadgeCatalog::spec(BadgeDomain::FindingRiskGovernanceValidity, 'rejected');
|
|
expect($rejected->label)->toBe('Rejected');
|
|
expect($rejected->color)->toBe('danger');
|
|
|
|
$missingSupport = BadgeCatalog::spec(BadgeDomain::FindingRiskGovernanceValidity, 'missing_support');
|
|
expect($missingSupport->label)->toBe('Missing support');
|
|
expect($missingSupport->color)->toBe('danger');
|
|
});
|