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/); });