@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user