@@ -32,6 +32,20 @@ function reviewCsvRows(string $content): array
|
||||
return $rows;
|
||||
}
|
||||
|
||||
test('review csv exports each frozen per order agreement once and distinguishes undefined caps from zero', function () {
|
||||
$report = app(ProcurementReviewReport::class)->build($this->f['issuer'], $this->f['r']->id);
|
||||
$binding = ['agreement_id' => 7, 'record_key' => 'synthetic', 'version' => 2, 'reference' => '=AGREEMENT-QA', 'basis' => 'per_order', 'currency' => 'MZN', 'unit' => 'un', 'includes_tax' => true,
|
||||
'max_order_value_minor' => null, 'max_order_quantity_milli' => 0, 'checked_order_value_minor' => 12345, 'checked_order_quantity_milli' => '1000'];
|
||||
$report['agreement_limits'] = [$binding, $binding];
|
||||
$rows = reviewCsvRows(app(ProcurementReviewCsv::class)->render($report));
|
||||
expect(array_values(array_filter($rows, fn ($row) => $row === ['Acordo por ordem', '7', 'Referência', "'=AGREEMENT-QA"])))->toHaveCount(1);
|
||||
expect($rows)->toContain(['Acordo por ordem', '7', 'Limite por ordem (centavos)', 'Não definido'])
|
||||
->toContain(['Acordo por ordem', '7', 'Limite por ordem (milésimos)', '0'])
|
||||
->toContain(['Acordo por ordem', '7', 'Total conferido nesta ordem (centavos)', '12345']);
|
||||
$report['agreement_limits'] = 'invalid';
|
||||
expect(fn () => app(ProcurementReviewCsv::class)->render($report))->toThrow(UnexpectedValueException::class);
|
||||
});
|
||||
|
||||
test('complete review csv keeps missing scores distinct from zero and makes no business writes', function () {
|
||||
$before = AuditLog::query()->count();
|
||||
$response = $this->get($this->url)->assertOk()
|
||||
|
||||
Reference in New Issue
Block a user