19 lines
691 B
TypeScript
19 lines
691 B
TypeScript
import assert from 'node:assert/strict';
|
|
import { readFile } from 'node:fs/promises';
|
|
import { resolve } from 'node:path';
|
|
import test from 'node:test';
|
|
|
|
test('D4 migration makes evidence and communications append-only for runtime', async () => {
|
|
const source = await readFile(
|
|
resolve(
|
|
process.cwd(),
|
|
'src/database/migrations/1787241600000-phase-d4-finding-evidence-communications.ts',
|
|
),
|
|
'utf8',
|
|
);
|
|
assert.match(source, /GRANT SELECT, INSERT ON TABLE/);
|
|
assert.match(source, /REVOKE UPDATE, DELETE ON TABLE/);
|
|
assert.match(source, /chk_inspection_finding_company_response_pdf/);
|
|
assert.match(source, /FOREIGN KEY \(communication_id, finding_id\)/);
|
|
});
|