From ea6a9fb8366ff59a36b36eeadf74b30bae4767c2 Mon Sep 17 00:00:00 2001 From: enlineawork Date: Thu, 10 Sep 2026 13:30:18 -0300 Subject: [PATCH] test(F6.1): lock read-only checklist and preparation stage --- .../f6-1-inspection-planning-hierarchy.test.ts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/api-v3/test/unit/f6-1-inspection-planning-hierarchy.test.ts b/api-v3/test/unit/f6-1-inspection-planning-hierarchy.test.ts index bef8470..8431720 100644 --- a/api-v3/test/unit/f6-1-inspection-planning-hierarchy.test.ts +++ b/api-v3/test/unit/f6-1-inspection-planning-hierarchy.test.ts @@ -50,12 +50,28 @@ test('F6.1 WEB inspection creation does not use Inventory operator snapshots', ( assert.doesNotMatch(create, /asset\.operator_company_id/); }); +test('F4 checklist classification is derived on read and never rewrites the persisted generation', () => { + const f4 = source('src/inspection-visits/f4-inspection-visits.service.ts'); + const d55 = source('src/database/migrations/1789063200000-phase-d5-5-web-planning-checklist.ts'); + + assert.match(d55, /REVOKE UPDATE, DELETE ON TABLE[\s\S]*inspection_visit_checklist_items/); + assert.match(f4, /classifyChecklistView/); + assert.match(f4, /FROM inspection_findings finding/); + assert.doesNotMatch(f4, /UPDATE inspection_visit_checklist_items/); + assert.doesNotMatch(f4, /reclassifyCurrentChecklist/); +}); + test('Field preparation is an Inspection stage, not a parallel sidebar module', () => { const layout = source('../web-v2/src/layout/AppLayout.tsx'); const briefing = source('../web-v2/src/pages/FieldBriefingsPage.tsx'); + const detail = source('../web-v2/src/pages/InspectionVisitDetailF61Page.tsx'); + const app = source('../web-v2/src/app/App.tsx'); assert.doesNotMatch(layout, /label: 'Preparación de campo'/); assert.match(briefing, /ETAPA DE LA INSPECCIÓN/); assert.match(briefing, /inspectionId/); assert.match(briefing, /Volver a la inspección/); + assert.match(detail, /ETAPA PREVIA AL CAMPO/); + assert.match(detail, /preparacion-campo\?inspectionId=/); + assert.match(app, /InspectionVisitDetailF61Page/); });