Some checks failed
Main Confidence / confidence (push) Failing after 54s
This pull request promotes the current state of `platform-dev` to the main integration branch `dev`. It includes recent features, fixes, and architectural refinements validated on the platform development track. Co-authored-by: Ahmed Darrazi <ahmed.darrazi@live.de> Reviewed-on: #297
37 lines
1.3 KiB
PHP
37 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Models\Finding;
|
|
use App\Services\Findings\FindingWorkflowService;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
|
|
uses(RefreshDatabase::class);
|
|
|
|
it('rejects triage from the removed acknowledged status', function (): void {
|
|
[$user, $tenant] = createUserWithTenant(role: 'owner');
|
|
|
|
$finding = Finding::factory()->for($tenant)->create([
|
|
'status' => 'acknowledged',
|
|
'acknowledged_at' => now(),
|
|
'acknowledged_by_user_id' => $user->getKey(),
|
|
]);
|
|
|
|
expect(fn () => app(FindingWorkflowService::class)->triage($finding, $tenant, $user))
|
|
->toThrow(\InvalidArgumentException::class, 'Finding cannot be triaged from the current status.');
|
|
});
|
|
|
|
it('rejects start progress from the removed acknowledged status', function (): void {
|
|
[$user, $tenant] = createUserWithTenant(role: 'owner');
|
|
|
|
$finding = Finding::factory()->for($tenant)->create([
|
|
'status' => 'acknowledged',
|
|
'triaged_at' => now()->subMinute(),
|
|
'acknowledged_at' => now(),
|
|
'acknowledged_by_user_id' => $user->getKey(),
|
|
]);
|
|
|
|
expect(fn () => app(FindingWorkflowService::class)->startProgress($finding, $tenant, $user))
|
|
->toThrow(\InvalidArgumentException::class, 'Finding cannot be moved to in-progress from the current status.');
|
|
});
|