@@ -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('<script>synthetic</script>');
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user