From 3e11e6687c1d9b2fa2334f9b60e9c555294ba0cd Mon Sep 17 00:00:00 2001 From: Stephen Hess Date: Tue, 1 Mar 2016 10:56:51 -0500 Subject: [PATCH] added `country_a` to label for all USA results --- helper/labelSchema.json | 3 ++- test/unit/helper/geojsonify.js | 2 +- test/unit/helper/labelGenerator_USA.js | 10 +++++----- test/unit/helper/labelSchema.js | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/helper/labelSchema.json b/helper/labelSchema.json index 4b555790..2c2859ea 100644 --- a/helper/labelSchema.json +++ b/helper/labelSchema.json @@ -1,7 +1,8 @@ { "USA": { "local": ["localadmin", "locality", "neighbourhood", "county"], - "regional": ["region_a", "region", "country"] + "regional": ["region_a", "region"], + "country": ["country_a"] }, "GBR": { "local": ["neighbourhood", "county", "localadmin", "locality", "region"], diff --git a/test/unit/helper/geojsonify.js b/test/unit/helper/geojsonify.js index a66421de..3c969302 100644 --- a/test/unit/helper/geojsonify.js +++ b/test/unit/helper/geojsonify.js @@ -199,7 +199,7 @@ module.exports.tests.search = function(test, common) { 'gid': 'osm:venue:34633854', 'layer': 'venue', 'source': 'osm', - 'label': 'Empire State Building, Manhattan, NY', + 'label': 'Empire State Building, Manhattan, NY, USA', 'name': 'Empire State Building', 'country_a': 'USA', 'country': 'United States', diff --git a/test/unit/helper/labelGenerator_USA.js b/test/unit/helper/labelGenerator_USA.js index 93715839..5512661d 100644 --- a/test/unit/helper/labelGenerator_USA.js +++ b/test/unit/helper/labelGenerator_USA.js @@ -22,7 +22,7 @@ module.exports.tests.san_francisco = function(test, common) { 'county': 'San Francisco County', 'locality': 'San Francisco' }; - t.equal(generator(doc),'San Francisco, San Francisco County, CA'); + t.equal(generator(doc),'San Francisco, San Francisco County, CA, USA'); t.end(); }); }; @@ -44,7 +44,7 @@ module.exports.tests.nyc_office = function(test, common) { 'locality': 'New York', 'neighbourhood': 'Flatiron District' }; - t.equal(generator(doc),'30 West 26th Street, Manhattan, NY'); + t.equal(generator(doc),'30 West 26th Street, Manhattan, NY, USA'); t.end(); }); }; @@ -65,7 +65,7 @@ module.exports.tests.nyc_bakery = function(test, common) { 'locality': 'New York', 'neighbourhood': 'Koreatown' }; - t.equal(generator(doc),'New York Bakery, Manhattan, NY'); + t.equal(generator(doc),'New York Bakery, Manhattan, NY, USA'); t.end(); }); }; @@ -83,7 +83,7 @@ module.exports.tests.ferry_building = function(test, common) { 'locality': 'San Francisco', 'neighbourhood': 'Financial District' }; - t.equal(generator(doc),'Ferry Building, San Francisco, CA'); + t.equal(generator(doc),'Ferry Building, San Francisco, CA, USA'); t.end(); }); }; @@ -98,7 +98,7 @@ module.exports.tests.california = function(test, common) { 'region': 'California', 'region_a': 'CA' }; - t.equal(generator(doc),'California, CA'); + t.equal(generator(doc),'California, CA, USA'); t.end(); }); }; diff --git a/test/unit/helper/labelSchema.js b/test/unit/helper/labelSchema.js index dcc3cdfa..442b7f70 100644 --- a/test/unit/helper/labelSchema.js +++ b/test/unit/helper/labelSchema.js @@ -13,7 +13,7 @@ module.exports.tests.interface = function(test, common) { }; module.exports.tests.valid = function(test, common) { - var valid_keys = ['localadmin', 'locality', 'neighbourhood', 'county', 'region_a', 'region', 'country']; + var valid_keys = ['localadmin', 'locality', 'neighbourhood', 'county', 'region_a', 'region', 'country', 'country_a']; var default_schema = { local: ['localadmin', 'locality', 'neighbourhood', 'county', 'region'], regional: ['country']