Só formatação automática (pint, vp check --fix), sem alterar comportamento. Excluídos da formatação os registos e artefactos com bytes fixos: docs/, integrations/, storage/, tmp/, output/, resources/data/, tests/Fixtures/, compras-release.json e AGENTS*.md. Scripts operacionais, integrations e auxiliares de teste ficam fora do lint (usam new Function; limpeza na fase 2). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
32 lines
1.8 KiB
JavaScript
32 lines
1.8 KiB
JavaScript
import fs from 'node:fs/promises';
|
|
import assert from 'node:assert/strict';
|
|
const source = await fs.readFile(
|
|
'scripts/supplier-evaluation-check.mjs',
|
|
'utf8',
|
|
);
|
|
const common = source.slice(
|
|
source.indexOf('const base ='),
|
|
source.indexOf('const author ='),
|
|
);
|
|
await new Function(
|
|
'fs',
|
|
'assert',
|
|
'return (async()=>{' +
|
|
common +
|
|
`
|
|
const viewer=client(); await viewer.enter('admin');
|
|
const dashboard=await viewer.request('/dashboard');
|
|
if(dashboard.page?.props.context?.enforced)await viewer.request('/contexto','POST',{area:'procurement',option:'procurement.internal'});
|
|
const page=await viewer.request('/stock/reposicao?need_state=pending');
|
|
assert.equal(page.status,200); assert.equal(page.page.component,'stock/replenishment');
|
|
const p=page.page.props; assert.equal(p.ready,true); assert.equal(p.recoveryReady,true);
|
|
assert.equal(p.canPrepare,false); assert.equal(p.canReview,false);
|
|
for(const key of ['rules','needs','history','workItems']){assert.ok(Array.isArray(p[key].data));assert.equal(typeof p[key].total,'number');}
|
|
assert.equal(p.filters.need_state,'pending'); assert.equal(p.schedulerStatus.result,'passed');
|
|
assert.ok(Date.now()-Date.parse(p.schedulerStatus.finished_at)<120000);
|
|
await fs.writeFile('docs/proofs/replenishment-pilot-http.json',JSON.stringify({checked_at:new Date().toISOString(),environment:base,component:'stock/replenishment',recovery_installed:true,pagination:['rules','needs','history','workItems'],filter:'pending',scheduler:p.schedulerStatus,administrator_read_only:true,business_commands:false,accounts_or_grants_changed:false,visual_browser_review:false},null,2));
|
|
console.log('Reposição: paginação, filtro, recuperação e passagem recente do serviço confirmados por HTTP.');
|
|
` +
|
|
'})()',
|
|
)(fs, assert);
|