commit melhorias compras3
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-11-22 10:56:58 +02:00
parent 4fac443dda
commit efd97e265b
130 changed files with 8917 additions and 363 deletions
@@ -0,0 +1,92 @@
import { App } from '@inertiajs/react';
import { renderToStaticMarkup } from 'react-dom/server';
import { expect, test } from 'vitest';
import Requests from '@/pages/stock/requests';
test('production use is available and the stored declared reference is escaped without suggesting external validation', () => {
const html = renderToStaticMarkup(
<App
initialComponent={Requests}
initialPage={{
component: 'stock/requests',
url: '/stock/requisicoes',
version: null,
clearHistory: false,
encryptHistory: true,
props: {
errors: {},
filters: {
view: 'all',
state: '',
search: '',
warehouse_id: null,
},
views: [],
states: {},
checkedAt: '2026-11-22T12:00:00Z',
ready: true,
canPrepare: true,
items: [],
warehouses: [],
costCenters: [],
equipment: [],
records: {
total: 1,
prev_page_url: null,
next_page_url: null,
data: [
{
id: 9,
status: 'draft',
snapshot: {
requester: { name: 'QA' },
warehouse: { name: 'QA' },
cost_center: { code: 'QA', name: 'QA' },
destination: 'Linha QA',
reason: 'Synthetic data',
priority: 'normal',
lines: [
{
item: {
id: 1,
code: 'QA',
name: 'Insumo QA',
unit: 'kg',
},
quantity_milli: 1000,
use: 'production',
destination: 'Linha QA',
equipment: null,
production: {
reference: 'OP-<QA>',
verification: 'user_supplied',
},
},
],
},
health: {
lines: [],
needs_reservation: false,
needs_check: false,
unconfirmed_deliveries: 0,
delivery_ready: false,
},
actions: {
canSubmit: false,
canReview: false,
canDeliver: false,
canManageReservation: false,
canReceive: false,
},
},
],
},
},
}}
/>,
);
expect(html).toContain('value="production"');
expect(html).toContain('Insumos para produção');
expect(html).toContain('Referência declarada: OP-&lt;QA&gt;');
expect(html).not.toContain('OP-<QA>');
});