@@ -0,0 +1,42 @@
|
||||
import { renderToStaticMarkup } from 'react-dom/server';
|
||||
import { expect, test } from 'vitest';
|
||||
import { ProcurementContractInsights } from '../../resources/js/components/procurement-contract-insights';
|
||||
|
||||
test('contract association keeps unknown legacy orders distinct from orders without an association and payments', () => {
|
||||
const html = renderToStaticMarkup(
|
||||
<ProcurementContractInsights
|
||||
data={{
|
||||
coverage: { unknown: 1 },
|
||||
currencies: [
|
||||
{
|
||||
classification: 'unknown',
|
||||
currency: 'MZN',
|
||||
count: 1,
|
||||
amount_minor: '10000',
|
||||
},
|
||||
{
|
||||
classification: 'partial',
|
||||
currency: 'USD',
|
||||
count: 1,
|
||||
amount_minor: '20000',
|
||||
},
|
||||
{
|
||||
classification: 'without_contract',
|
||||
currency: null,
|
||||
count: 1,
|
||||
amount_minor: null,
|
||||
},
|
||||
],
|
||||
}}
|
||||
/>,
|
||||
);
|
||||
expect(html).toContain('Associação por determinar');
|
||||
expect(html).toContain(
|
||||
'não foram classificadas como compras fora de contrato',
|
||||
);
|
||||
expect(html).toContain('Parte das linhas com contrato associado');
|
||||
expect(html).toContain('100,00 MZN');
|
||||
expect(html).toContain('200,00 USD');
|
||||
expect(html).toContain('Indeterminado');
|
||||
expect(html).toContain('Não representam pagamentos');
|
||||
});
|
||||
Reference in New Issue
Block a user