commit compras1 2811
tests / ci (push) Waiting to run

This commit is contained in:
2026-11-28 07:11:35 +02:00
parent d58b75c87a
commit eb32c74c56
202 changed files with 17463 additions and 1526 deletions
@@ -3,6 +3,102 @@ import { renderToStaticMarkup } from 'react-dom/server';
import { expect, test } from 'vitest';
import Search from '@/pages/search/procurement';
test('warehouse search preserves the distinct internal reference event state and result page', () => {
const html = renderToStaticMarkup(
<App
initialComponent={Search}
initialPage={{
component: 'search/procurement',
url: '/compras/pesquisa?q=RA-9',
version: null,
clearHistory: false,
encryptHistory: true,
props: {
errors: {},
term: 'RA-9',
warehouseRequestSearchAvailable: true,
groups: [
{
key: 'warehouse_requests',
title: 'Requisições internas de armazém',
records: {
total: 16,
current_page: 1,
last_page: 2,
prev_page_url: null,
next_page_url:
'/compras/pesquisa?q=RA&warehouse_requests_page=2',
data: [
{
id: 9,
title: 'RA-9',
detail: 'partial',
href: '/stock/requisicoes/9',
},
],
},
},
],
},
}}
/>,
);
expect(html).toContain('Requisições internas de armazém');
expect(html).toContain('RA-9');
expect(html).toContain('Entrega parcial');
expect(html).toContain('warehouse_requests_page=2');
expect(html).toContain('/stock/requisicoes/9');
expect(html).toContain('nome do requisitante preservado');
});
test('supply reference search shows current versions native targets and its own pagination', () => {
const html = renderToStaticMarkup(
<App
initialComponent={Search}
initialPage={{
component: 'search/procurement',
url: '/compras/pesquisa?q=AG',
version: null,
clearHistory: false,
encryptHistory: true,
props: {
errors: {},
term: 'AG',
supplySearchAvailable: true,
groups: [
{
key: 'agreements',
title: 'Acordos',
records: {
total: 16,
current_page: 1,
last_page: 2,
prev_page_url: null,
next_page_url:
'/compras/pesquisa?q=AG&agreements_page=2',
data: [
{
id: 5,
title: 'AG <QA> · v2',
detail: 'suspended',
href: '/compras/fornecimento?view=agreements&record_id=5#supply-record-5',
},
],
},
},
],
},
}}
/>,
);
expect(html).toContain('AG &lt;QA&gt; · v2');
expect(html).toContain('Suspenso');
expect(html).toContain('agreements_page=2');
expect(html).toContain('view=agreements&amp;record_id=5#supply-record-5');
expect(html).toContain('nome do fornecedor preservado');
expect(html).not.toContain('acesso financeiro');
});
test('process search separates result groups escapes text and retains page links', () => {
const html = renderToStaticMarkup(
<App