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
@@ -3,6 +3,43 @@ import { describe, expect, it } from 'vitest';
import { ProcurementPaymentInsights } from '../../resources/js/components/procurement-payment-insights';
describe('confirmed payment expense', () => {
it('shows supplier identity with exact totals and preserves filters in its independent pagination', () => {
const html = renderToStaticMarkup(
<ProcurementPaymentInsights
pageHref="/relatorios?from=2026-11-01&search=REQ-QA"
data={{
from: null,
to: null,
coverage: {
invoices: 21,
indeterminate: 0,
confirmed_payments: 21,
},
currencies: [],
suppliers: {
data: [
{
supplier_id: 21,
supplier_name: '<script>synthetic</script>',
currency: 'MZN',
count: 1,
amount_minor: '9007199254740993',
},
],
total: 21,
current_page: 2,
last_page: 2,
},
}}
/>,
);
expect(html).toContain('Despesa por fornecedor');
expect(html).toContain('&lt;script&gt;synthetic&lt;/script&gt;');
expect(html).toContain('90.071.992.547.409,93 MZN');
expect(html).toContain('supplier_page=1');
expect(html).toContain('search=REQ-QA');
expect(html).toContain('Página 2 de 2');
});
it('keeps currencies separate and formats amounts without floating point', () => {
const html = renderToStaticMarkup(
<ProcurementPaymentInsights