commit compras5 2711
tests / ci (push) Waiting to run

This commit is contained in:
2026-11-27 20:19:21 +02:00
parent 7486007fcf
commit d58b75c87a
57 changed files with 2803 additions and 116 deletions
+12
View File
@@ -48,6 +48,18 @@ function reportCopy(Requisition $original, string $number, array $attributes = [
return $copy;
}
test('contract report preserves unknown legacy associations without writes and exports the same documentary basis', function () {
$this->withoutVite();
$before = [DB::table('purchase_orders')->get()->toJson(), DB::table('budget_entries')->get()->toJson(), DB::table('audit_logs')->get()->toJson()];
$this->get('/relatorios')->assertOk()->assertInertia(fn (Assert $page) => $page->where('contractInsights.coverage.unknown', 1)
->where('contractInsights.coverage.without_contract', 0)->where('contractInsights.currencies.0.amount_minor', '10000'));
$csv = $this->get('/relatorios/contratos.csv')->assertOk()->assertDownload()->streamedContent();
expect($csv)->toContain('"Associação por determinar";MZN;1;10000')->toContain('não pagamentos')
->and([DB::table('purchase_orders')->get()->toJson(), DB::table('budget_entries')->get()->toJson(), DB::table('audit_logs')->get()->toJson()])->toBe($before);
$this->actingAs(User::factory()->create(['tenant_id' => $this->f['tenant']->id, 'purchasing_role' => PurchasingRole::Requester]));
$this->get('/relatorios/contratos.csv')->assertForbidden();
});
test('needed attention report filters all pages and CSV by native status and needed date without writes', function () {
$this->freezeTime();
foreach (range(1, 27) as $index) {