Files
dh-inspeccion-v2/api-v3/test/unit/phase-d5-3-18-office-workspace.test.ts

27 lines
1.2 KiB
TypeScript

import assert from 'node:assert/strict';
import test from 'node:test';
import { readFileSync } from 'node:fs';
import { resolve } from 'node:path';
const findingsService = readFileSync(resolve(process.cwd(), 'src/inspection-findings/inspection-findings.service.ts'), 'utf8');
test('D5.3.18 exposes one server-side office workflow for the finding dossier', () => {
assert.match(findingsService, /officeWorkflow/);
assert.match(findingsService, /WAITING_COMPANY/);
assert.match(findingsService, /COMPANY_OVERDUE/);
assert.match(findingsService, /DEFINE_VERIFICATION/);
assert.match(findingsService, /PLAN_VERIFICATION/);
assert.match(findingsService, /VERIFICATION_PLANNED/);
assert.match(findingsService, /RESCHEDULE_VERIFICATION/);
assert.match(findingsService, /READY_TO_CLOSE/);
assert.match(findingsService, /CLOSED/);
});
test('D5.3.18 preserves administrative and operational dates as independent fields', () => {
assert.match(findingsService, /correctionDueOn/);
assert.match(findingsService, /companyResponseReceivedOn/);
assert.match(findingsService, /companyCommittedCorrectionOn/);
assert.match(findingsService, /nextControlOn/);
assert.doesNotMatch(findingsService, /finding\.correctionDueOn = dto\.nextControlOn/);
});