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
25 lines
734 B
PHP
25 lines
734 B
PHP
<?php
|
|
|
|
use App\Filament\Resources\FindingResource\Pages\ListFindings;
|
|
use App\Models\Finding;
|
|
use Filament\Facades\Filament;
|
|
use Livewire\Livewire;
|
|
|
|
test('readonly users cannot triage findings', function () {
|
|
[$user, $tenant] = createUserWithTenant(role: 'readonly');
|
|
$this->actingAs($user);
|
|
Filament::setTenant($tenant, true);
|
|
|
|
$finding = Finding::factory()->for($tenant)->create([
|
|
'finding_type' => Finding::FINDING_TYPE_DRIFT,
|
|
'status' => Finding::STATUS_NEW,
|
|
]);
|
|
|
|
Livewire::test(ListFindings::class)
|
|
->assertTableActionDisabled('triage', $finding)
|
|
->callTableAction('triage', $finding);
|
|
|
|
$finding->refresh();
|
|
expect($finding->status)->toBe(Finding::STATUS_NEW);
|
|
});
|