From 78e1d5cbf664468beeed39d2217ee7eab6aab58b Mon Sep 17 00:00:00 2001 From: enlineawork Date: Tue, 8 Sep 2026 22:35:26 -0300 Subject: [PATCH] test(f5): make merge compatibility area-based --- api-v3/test/unit/f3-1-chronological-merge.test.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api-v3/test/unit/f3-1-chronological-merge.test.ts b/api-v3/test/unit/f3-1-chronological-merge.test.ts index 8f9b96c..37c364f 100644 --- a/api-v3/test/unit/f3-1-chronological-merge.test.ts +++ b/api-v3/test/unit/f3-1-chronological-merge.test.ts @@ -19,12 +19,14 @@ test('F3.1 registra cada fusión como evento append-only con snapshots', () => { assert.match(migration, /append-only/); }); -test('F3.1 sólo permite fusionar Instalaciones o Subinstalaciones compatibles', () => { +test('F3.1/F5 sólo permite fusionar Instalaciones o Subinstalaciones compatibles dentro de la misma Área física', () => { assert.match(service, /MERGEABLE_TYPES = new Set\(\['instalacion', 'subinstalacion'\]\)/); assert.match(service, /INVENTORY_MERGE_TYPE_INVALID/); - assert.match(service, /INVENTORY_MERGE_CONTEXT_MISMATCH/); + assert.match(service, /resolvePhysicalAreaId/); + assert.match(service, /INVENTORY_MERGE_AREA_MISMATCH/); assert.match(service, /INVENTORY_MERGE_PARENT_MISMATCH/); assert.match(service, /INVENTORY_MERGE_CHILD_FAMILY_CONFLICT/); + assert.doesNotMatch(service, /source\.operatorCompanyId\s*!==\s*canonical\.operatorCompanyId/); }); test('F3.1 preserva referencias históricas y sólo reubica hijos actuales', () => {