@@ -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');
|
||||
});
|
||||
Reference in New Issue
Block a user