@@ -12,6 +12,7 @@ use App\Services\ProcurementEvidenceBrief;
|
||||
use App\Services\ProcurementReviewReport;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Inertia\Testing\AssertableInertia as Assert;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
|
||||
require_once __DIR__.'/../Support/QualificationFixture.php';
|
||||
|
||||
@@ -44,6 +45,17 @@ test('review report returns a private read-only consultation without inventing m
|
||||
expect(AuditLog::query()->count())->toBe($before);
|
||||
});
|
||||
|
||||
test('maintenance-only membership cannot read business review documents through HTML CSV or the report service', function () {
|
||||
$actor = $this->f['issuer'];
|
||||
$profile = DB::table('organization_profiles')->insertGetId(['tenant_id' => $actor->tenant_id, 'name' => 'Synthetic maintenance only',
|
||||
'permissions' => json_encode(['procurement'], JSON_THROW_ON_ERROR), 'work_contexts' => json_encode(['procurement.internal'], JSON_THROW_ON_ERROR), 'version' => 1]);
|
||||
DB::table('organization_memberships')->insert(['tenant_id' => $actor->tenant_id, 'user_id' => $actor->id, 'profile_id' => $profile, 'maintenance' => true]);
|
||||
DB::table('organization_access')->insert(['tenant_id' => $actor->tenant_id, 'active' => true, 'version' => 1]);
|
||||
expect(fn () => app(ProcurementReviewReport::class)->build($actor, $this->f['r']->id))->toThrow(HttpException::class);
|
||||
$this->get($this->url)->assertForbidden();
|
||||
$this->get('/requisicoes/'.$this->f['r']->id.'/relatorio.csv')->assertForbidden();
|
||||
});
|
||||
|
||||
test('review report separates current comparison from outdated documentary identities and results', function () {
|
||||
$set = documentaryReportRecords($this);
|
||||
$this->f['quote']->update(['reference' => 'REFERENCIA-POSTERIOR']);
|
||||
|
||||
Reference in New Issue
Block a user