diff --git a/api-v3/test/unit/f5-inventory-authoritative-contract.test.ts b/api-v3/test/unit/f5-inventory-authoritative-contract.test.ts index 97106d5..ac4eeed 100644 --- a/api-v3/test/unit/f5-inventory-authoritative-contract.test.ts +++ b/api-v3/test/unit/f5-inventory-authoritative-contract.test.ts @@ -20,6 +20,7 @@ test('F5 territory preload is exactly the authorized Tablas de yacimiento y area assert.equal(source.rows.length, 230); const areas = new Set(source.rows.map((row) => key(row.area))); + const literalYacimientoNames = new Set(source.rows.map((row) => row.yacimiento.trim())); const yacimientos = new Set(source.rows.map((row) => key(row.yacimiento))); const areaYacimiento = new Set(source.rows.map((row) => `${key(row.area)}|${key(row.yacimiento)}`)); const departments = new Set(source.rows.map((row) => key(row.departamento))); @@ -27,12 +28,26 @@ test('F5 territory preload is exactly the authorized Tablas de yacimiento y area const operators = new Set(source.rows.map((row) => key(row.empresaOperadora))); assert.equal(areas.size, 64); - assert.equal(yacimientos.size, 220); + // The authorized workbook contains 220 literal Yacimiento names. The F5 key + // intentionally folds accents/punctuation/case, so one pair of literal names + // collides into the same normalized key. Yacimiento identity is Area+Yacimiento, + // never a globally-unique normalized name. + assert.equal(literalYacimientoNames.size, 220); + assert.equal(yacimientos.size, 219); assert.equal(areaYacimiento.size, 230); assert.equal(departments.size, 7); assert.equal(concessionTypes.size, 2); assert.equal(operators.size, 13); + const literalNamesByKey = new Map>(); + for (const row of source.rows) { + const normalized = key(row.yacimiento); + const literals = literalNamesByKey.get(normalized) ?? new Set(); + literals.add(row.yacimiento.trim()); + literalNamesByKey.set(normalized, literals); + } + assert.equal([...literalNamesByKey.values()].filter((items) => items.size > 1).length, 1); + const areasByYacimiento = new Map>(); for (const row of source.rows) { const yacimiento = key(row.yacimiento);