@@ -1,4 +1,7 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { App } from '@inertiajs/react';
|
||||
import { renderToStaticMarkup } from 'react-dom/server';
|
||||
import Parts from '@/pages/purchases/parts';
|
||||
import {
|
||||
orderPartDraftKey,
|
||||
orderPartMinor,
|
||||
@@ -52,3 +55,85 @@ describe('explicit order-part monetary input', () => {
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
it('foreign legacy adoption shows an unknown reference as pending instead of a zero amount', () => {
|
||||
const html = renderToStaticMarkup(
|
||||
<App
|
||||
initialComponent={Parts}
|
||||
initialPage={{
|
||||
component: 'purchases/parts',
|
||||
url: '/ordens/preparar',
|
||||
version: null,
|
||||
clearHistory: false,
|
||||
encryptHistory: true,
|
||||
props: {
|
||||
errors: {},
|
||||
candidates: {
|
||||
data: [],
|
||||
prev_page_url: null,
|
||||
next_page_url: null,
|
||||
},
|
||||
preview: {
|
||||
selection: {
|
||||
sources: [
|
||||
{
|
||||
award_id: 2,
|
||||
items: [
|
||||
{
|
||||
quotation_item_id: 3,
|
||||
quantity: '1.000',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
can_issue: false,
|
||||
financial: [
|
||||
{
|
||||
origin: 1,
|
||||
award_id: 2,
|
||||
requires_adoption: true,
|
||||
allocations: [],
|
||||
adoption_lines: [
|
||||
{
|
||||
line_id: 4,
|
||||
description:
|
||||
'Synthetic imported material',
|
||||
subtotal_minor: 100,
|
||||
total_minor: 100,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
prepared: {
|
||||
fingerprint: 'a'.repeat(64),
|
||||
currency: 'USD',
|
||||
subtotal_minor: 100,
|
||||
total_minor: 100,
|
||||
sources: [
|
||||
{
|
||||
requisition_id: 1,
|
||||
award_id: 2,
|
||||
currency: 'USD',
|
||||
items: [
|
||||
{
|
||||
description:
|
||||
'Synthetic imported material',
|
||||
quotation_item_id: 3,
|
||||
quantity_offset_milli: 0,
|
||||
quantity_milli: 1000,
|
||||
total_minor: 100,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
},
|
||||
}}
|
||||
/>,
|
||||
);
|
||||
expect(html).toContain('Referência por conferir');
|
||||
expect(html).toContain('todos os artigos da proposta');
|
||||
expect(html).not.toContain('0,00');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user