From 47203ff0da77dd9b35194e0ff70c40950c088389 Mon Sep 17 00:00:00 2001 From: enlineawork Date: Wed, 9 Sep 2026 14:10:50 -0300 Subject: [PATCH] =?UTF-8?q?F6.1=20=C2=B7=20contrato=20de=20cat=C3=A1logo?= =?UTF-8?q?=20contextual=20en=20Yacimientos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api-v3/test/unit/f6-1-findings-mobile-open.test.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/api-v3/test/unit/f6-1-findings-mobile-open.test.ts b/api-v3/test/unit/f6-1-findings-mobile-open.test.ts index 6c98a6c..0fe7347 100644 --- a/api-v3/test/unit/f6-1-findings-mobile-open.test.ts +++ b/api-v3/test/unit/f6-1-findings-mobile-open.test.ts @@ -17,15 +17,20 @@ test('F6.1 allows direct findings only on Yacimiento, Instalacion and Subinstala assert.match(findings, /FIELD_FINDING_FAMILY_REQUIRED/); }); -test('F6.1 keeps OTROS and add-another available for every accepted finding target', () => { +test('F6.1 uses contextual type catalog for Yacimiento and keeps OTROS/add-another everywhere', () => { const findings = source('src/inspection-visits/field-findings.service.ts'); const resolver = source('src/inspection-findings/f3-finding-catalog-resolver.service.ts'); + const catalog = source('src/inspection-findings/finding-catalog.service.ts'); const androidFinding = source('../android-app/app/src/main/java/com/korexlabs/dhinspeccion/ui/FieldFindingScreen.kt'); assert.match(findings, /canAddAnother: true/); + assert.match(resolver, /typeCode\.toLowerCase\(\) === 'yacimiento'/); + assert.match(resolver, /contextualCatalog\.listApplicableForAsset\(assetId, query\)/); + assert.match(resolver, /catalogSource: 'ASSET_TYPE'/); + assert.match(catalog, /finding_catalog_item_asset_types mapping/); + assert.match(catalog, /finding_catalog_asset_overrides override/); assert.match(resolver, /code: 'OTHER'/); assert.match(resolver, /label: 'OTROS'/); - assert.match(resolver, /El Yacimiento admite Hallazgos directos/); assert.match(androidFinding, /OTROS · No está en el catálogo/); assert.match(androidFinding, /También podés registrar otro Hallazgo sobre el mismo Inventario/); });