commit compras 2711
tests / ci (push) Waiting to run

This commit is contained in:
2026-11-27 13:49:31 +02:00
parent dc73540558
commit e709d900d1
81 changed files with 5352 additions and 107 deletions
@@ -0,0 +1,45 @@
import { App } from '@inertiajs/react';
import { renderToStaticMarkup } from 'react-dom/server';
import { expect, test } from 'vitest';
import Reconciliation from '@/components/import-estimate-reconciliation';
test('reconciliation exposes explicit source remainder and does not select a financial allocation automatically', () => {
const html = renderToStaticMarkup(
<App
initialComponent={Reconciliation}
initialPage={{
component: 'reconciliation',
url: '/qa',
version: null,
clearHistory: false,
encryptHistory: true,
props: {
errors: {},
planId: 2,
url: '/compras/importacoes/1/custos',
historyKey: 'synthetic-private-key',
financialRevision: 1,
sources: {
data: [
{
id: 4,
version: 1,
requisition_id: 9,
budget_id: 6,
revision: 2,
reserved_minor: 12345,
committed_minor: 0,
},
],
prev_page_url: null,
next_page_url: null,
},
},
}}
/>,
);
expect(html).toContain('saldo 123.45 MZN');
expect(html).toContain('parcela que corresponde aos documentos conferidos');
expect(html).toContain('restantes ordens');
expect(html).toContain('disabled');
});