fix(voice): treat a Zone as retired only in Nepal

Every name ending in "Zone" was kept without a level and refused as a retired
administrative identity. That is right for Nepal, which replaced its zones in
2015, but zones are current units elsewhere: Ethiopia's "Gamo Zone" was
refused. The selector now keeps the verified level unless display_name places
the zone in Nepal or names no country, and the client no longer reads "Zone"
as a retired level when the source verified one.
This commit is contained in:
Manjunath committed 2026-11-03 17:27:26 +05:30
1 parent 682427ef1d
commit 451be8e3b7
4 files changed
+73 -2

No files matched your search

@@ -853,6 +853,34 @@ test('admin identity comes only from unambiguous evidence on the selected row',
assert.equal('adminLevel' in retiredPrefix, false);
});
test('a Zone is retired only in Nepal, where zones were replaced', () => {
const current = selectOutlineResult(
[
boundary({
name: 'Gamo Zone',
addresstype: 'county',
display_name: 'Gamo Zone, South Ethiopia Regional State, Ethiopia',
}),
],
{ kind: 'admin', query: 'Gamo Zone' },
).outline;
assert.equal(current.adminArea, 'Gamo Zone');
assert.equal(current.adminLevel, 'admin2');
const retired = selectOutlineResult(
[
boundary({
name: 'Bagmati Zone',
addresstype: 'state',
display_name: 'Bagmati Zone, Nepal',
}),
],
{ kind: 'admin', query: 'Bagmati Zone' },
).outline;
assert.equal(retired.adminArea, 'Bagmati Zone');
assert.equal('adminLevel' in retired, false);
});
test('admin identity validates the full name before display truncation', () => {
const longValidName = `Province of ${'Example '.repeat(24)}`.trim();
const valid = selectOutlineResult(