@@ -87,3 +87,46 @@ test('approved requisitions display the preserved source independently of availa
|
||||
expect(frozen).toContain('<script>QA</script>');
|
||||
expect(renderToStaticMarkup(<CapitalAssignmentSummary />)).toBe('');
|
||||
});
|
||||
|
||||
test('capital lineage distinguishes the original receipt from current returns and reversal', () => {
|
||||
const html = render(CapitalRegister, {
|
||||
records: page([source]),
|
||||
history: page([source]),
|
||||
departments: [],
|
||||
equipment: [],
|
||||
canManage: false,
|
||||
actorId: 1,
|
||||
tenantId: 1,
|
||||
trace: {
|
||||
orders: page([
|
||||
{
|
||||
id: 7,
|
||||
description: 'Synthetic item',
|
||||
quantity: '2.000',
|
||||
unit: 'un',
|
||||
order_id: 8,
|
||||
order_number: 'OC-QA',
|
||||
},
|
||||
]),
|
||||
receipts: page([
|
||||
{
|
||||
id: 9,
|
||||
description: 'Synthetic item',
|
||||
unit: 'un',
|
||||
receipt_id: 10,
|
||||
order_id: 8,
|
||||
received_on: '2026-11-27',
|
||||
quality_status: 'compliant',
|
||||
accepted_quantity: '2.000',
|
||||
reversed: true,
|
||||
returned_quantity: '1.000',
|
||||
},
|
||||
]),
|
||||
},
|
||||
});
|
||||
expect(html).toContain('Aceite no original: 2.000');
|
||||
expect(html).toContain('Devolução ao fornecedor: 1.000');
|
||||
expect(html).toContain('Recepção estornada');
|
||||
expect(html).toContain('/ordens/8');
|
||||
expect(html).not.toContain('<form');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user