From c11808f5603630af4f7b21fb555422e102a3b649 Mon Sep 17 00:00:00 2001 From: enlineawork Date: Tue, 8 Sep 2026 09:15:26 -0300 Subject: [PATCH] test: align automatic report contract with F4 sealing --- .../unit/phase-d5-3-20-automatic-word-report.test.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/api-v3/test/unit/phase-d5-3-20-automatic-word-report.test.ts b/api-v3/test/unit/phase-d5-3-20-automatic-word-report.test.ts index 9a9b157..fd6b2d9 100644 --- a/api-v3/test/unit/phase-d5-3-20-automatic-word-report.test.ts +++ b/api-v3/test/unit/phase-d5-3-20-automatic-word-report.test.ts @@ -11,14 +11,15 @@ const controller = read('src/inspection-reports/inspection-reports.controller.ts const builder = read('src/inspection-reports/inspection-report-word-builder.ts'); const wordService = read('src/inspection-reports/inspection-report-word.service.ts'); -test('D5.3.20 freezes one report automatically in the same act-closing transaction', () => { +test('D5.3.20/F4 freezes one report from each sealed act and generates its Word artifact', () => { assert.match(closing, /await this\.reports\.ensureFrozenReport\(manager, actId, principal, request\)/); assert.match(closing, /await this\.reports\.ensureWordForAct\(actId\)/); assert.match(reports, /async ensureFrozenReport\(/); assert.match(reports, /SELECT id FROM inspection_reports WHERE act_id/); + assert.match(reports, /act\.status = 'SEALED'/); }); -test('D5.3.20 stores an integrity-checked Word artifact without changing the frozen report', () => { +test('D5.3.20 stores an integrity-checked Word artifact without changing the frozen source snapshot', () => { assert.match(migration, /ADD COLUMN word_status varchar\(24\)/); assert.match(migration, /word_sha256 char\(64\)/); assert.match(migration, /word_generated_at timestamptz/); @@ -35,7 +36,8 @@ test('D5.3.20 builds OOXML Word from the frozen act snapshot without external do assert.doesNotMatch(builder, /nodemailer|libreoffice|pandoc/i); }); -test('D5.3.20 keeps frozen report generation act-scoped and leaves email delivery for a configured phase', () => { - assert.match(closing, /findingsRemainOpen: true/); +test('F4 keeps report generation act-scoped while findings and inspection lifecycle remain independent', () => { + assert.match(closing, /findingsRemainIndependent: true/); + assert.match(closing, /inspectionRemainsIndependent: true/); assert.doesNotMatch(migration, /smtp|email_outbox|mail_delivery/i); });