fix(actas): keep sealed act content findings-only
This commit is contained in:
@@ -94,12 +94,12 @@ test('F6.9 revision migration archives both first document versions before servi
|
||||
assert.match(migration, /PRIMARY KEY \(report_id,template_version\)/);
|
||||
});
|
||||
|
||||
test('F6.9 includes field photos from installations without their own findings', async () => {
|
||||
test('Acta ignores standalone field photos while the technical Informe remains independent', async () => {
|
||||
const other = await sharp(photo).resize(75).png().toBuffer();
|
||||
const unlinked = { id: 'photo-other-asset', assetId: 'asset-2', title: 'Otra instalación', sha256: digest(other), buffer: other };
|
||||
const withUnlinked = await buildInspectionActPdf(sealed, [evidence, unlinked]);
|
||||
const linkedOnly = await buildInspectionActPdf(sealed, [evidence]);
|
||||
assert.ok(withUnlinked.buffer.length > linkedOnly.buffer.length + 500);
|
||||
assert.ok(Math.abs(withUnlinked.buffer.length - linkedOnly.buffer.length) < 500);
|
||||
const word = buildInspectionReportWord({ code: 'INF-OTHER', title: 'Informe', generatedAt: new Date(),
|
||||
frozenSha256: 'c'.repeat(64), frozenSnapshot: { sealedAct: sealed }, photos: [evidence, unlinked] });
|
||||
assert.ok(word.buffer.includes(Buffer.from('OTRAS INSTALACIONES INSPECCIONADAS')));
|
||||
|
||||
Reference in New Issue
Block a user