diff --git a/helper/labelSchema.js b/helper/labelSchema.js index 0547e2ad..699e1c88 100644 --- a/helper/labelSchema.js +++ b/helper/labelSchema.js @@ -12,7 +12,7 @@ module.exports = { }, 'USA': { 'borough': getFirstProperty(['borough']), - 'local': getFirstProperty(['locality', 'localadmin']), + 'local': getFirstProperty(['locality', 'localadmin', 'county']), 'regional': getUsOrCaState, 'country': getUSACountryValue }, diff --git a/test/unit/helper/labelGenerator_USA.js b/test/unit/helper/labelGenerator_USA.js index bdcc5f2f..3097bcca 100644 --- a/test/unit/helper/labelGenerator_USA.js +++ b/test/unit/helper/labelGenerator_USA.js @@ -51,6 +51,25 @@ module.exports.tests.united_states = function(test, common) { t.end(); }); +test('county value should be used when there is no localadmin', function(t) { + var doc = { + 'name': 'venue name', + 'layer': 'venue', + 'housenumber': 'house number', + 'street': 'street name', + 'neighbourhood': 'neighbourhood name', + 'county': 'county name', + 'macrocounty': 'macrocounty name', + 'region_a': 'region abbr', + 'region': 'region name', + 'macroregion': 'macroregion name', + 'country_a': 'USA', + 'country': 'United States' + }; + t.equal(generator(doc),'venue name, county name, region abbr, USA'); + t.end(); + }); + test('street', function(t) { var doc = { 'name': 'house number street name',