@@ -12,6 +12,43 @@ import {
|
||||
searchProcurementMenu,
|
||||
} from '@/lib/procurement-menu-search';
|
||||
|
||||
test('common payment attribution retains its existing authorised finance menu entry', () => {
|
||||
const path = '/afectacoes-fornecedores/12/imputacao';
|
||||
expect(
|
||||
activeProcurementEntry(
|
||||
procurementNavigation(
|
||||
['finance'],
|
||||
true,
|
||||
undefined,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
{ payments: true },
|
||||
),
|
||||
path,
|
||||
),
|
||||
).toBe('supplier_settlements');
|
||||
expect(
|
||||
activeProcurementEntry(procurementNavigation(['finance'], true), path),
|
||||
).toBeUndefined();
|
||||
expect(
|
||||
activeProcurementEntry(
|
||||
procurementNavigation(
|
||||
['requester'],
|
||||
false,
|
||||
undefined,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
{ payments: true },
|
||||
),
|
||||
path,
|
||||
),
|
||||
).toBeUndefined();
|
||||
});
|
||||
|
||||
test.each([
|
||||
'/compras/fornecimento',
|
||||
'/compras/fornecimento?view=agreements&record_id=12',
|
||||
|
||||
@@ -3,6 +3,27 @@ import { describe, expect, it } from 'vitest';
|
||||
import { ProcurementPaymentInsights } from '../../resources/js/components/procurement-payment-insights';
|
||||
|
||||
describe('confirmed payment expense', () => {
|
||||
it('describes one confirmed payment in the singular without changing the exact amount', () => {
|
||||
const html = renderToStaticMarkup(
|
||||
<ProcurementPaymentInsights
|
||||
data={{
|
||||
from: null,
|
||||
to: null,
|
||||
coverage: {
|
||||
invoices: 1,
|
||||
indeterminate: 0,
|
||||
confirmed_payments: 1,
|
||||
},
|
||||
currencies: [
|
||||
{ currency: 'MZN', count: 1, amount_minor: '4000' },
|
||||
],
|
||||
}}
|
||||
/>,
|
||||
);
|
||||
expect(html).toContain('1 pagamento confirmado.');
|
||||
expect(html).toContain('40,00 MZN');
|
||||
expect(html).not.toContain('1 pagamentos');
|
||||
});
|
||||
it('shows supplier identity with exact totals and preserves filters in its independent pagination', () => {
|
||||
const html = renderToStaticMarkup(
|
||||
<ProcurementPaymentInsights
|
||||
|
||||
Reference in New Issue
Block a user