Implements spec 111 (Findings workflow + SLA) and fixes Workspace findings SLA settings UX/validation. Key changes: - Findings workflow service + SLA policy and alerting. - Workspace settings: allow partial SLA overrides without auto-filling unset severities in the UI; effective values still resolve via defaults. - New migrations, jobs, command, UI/resource updates, and comprehensive test coverage. Tests: - `vendor/bin/sail artisan test --compact` (1779 passed, 8 skipped). Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #135
53 lines
2.0 KiB
PHP
53 lines
2.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');
|
|
|
|
$closed = BadgeCatalog::spec(BadgeDomain::FindingStatus, 'closed');
|
|
expect($closed->label)->toBe('Closed');
|
|
|
|
$riskAccepted = BadgeCatalog::spec(BadgeDomain::FindingStatus, 'risk_accepted');
|
|
expect($riskAccepted->label)->toBe('Risk accepted');
|
|
});
|