test(f5): make merge compatibility area-based

This commit is contained in:
2026-09-08 22:35:26 -03:00
parent bd110b22f3
commit 78e1d5cbf6
@@ -19,12 +19,14 @@ test('F3.1 registra cada fusión como evento append-only con snapshots', () => {
assert.match(migration, /append-only/); 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, /MERGEABLE_TYPES = new Set\(\['instalacion', 'subinstalacion'\]\)/);
assert.match(service, /INVENTORY_MERGE_TYPE_INVALID/); 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_PARENT_MISMATCH/);
assert.match(service, /INVENTORY_MERGE_CHILD_FAMILY_CONFLICT/); 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', () => { test('F3.1 preserva referencias históricas y sólo reubica hijos actuales', () => {