Browse Source

Fix middleware unit tests

pull/426/head
Diana Shkolnikov 9 years ago committed by Julian Simioni
parent
commit
31374b5381
  1. 14
      test/unit/middleware/confidenceScore.js
  2. 22
      test/unit/middleware/localNamingConventions.js

14
test/unit/middleware/confidenceScore.js

@ -70,13 +70,21 @@ module.exports.tests.confidenceScore = function(test, common) {
value: 1, value: 1,
center_point: { lat: 100.1, lon: -50.5 }, center_point: { lat: 100.1, lon: -50.5 },
name: { default: 'test name1' }, name: { default: 'test name1' },
admin0: 'country1', admin1: 'state1', admin2: 'city1' parent: {
country: 'country1',
region: 'state1',
county: 'city1'
}
}, { }, {
_score: 20,
value: 2, value: 2,
center_point: { lat: 100.2, lon: -51.5 }, center_point: { lat: 100.2, lon: -51.5 },
name: { default: 'test name2' }, name: { default: 'test name2' },
admin0: 'country2', admin1: 'state2', admin2: 'city2', parent: {
_score: 20 country: 'country2',
region: 'state2',
county: 'city2'
}
}], }],
meta: {scores: [10]} meta: {scores: [10]}
}; };

22
test/unit/middleware/localNamingConventions.js

@ -15,9 +15,11 @@ module.exports.tests.flipNumberAndStreet = function(test, common) {
'number': '1', 'number': '1',
'street': 'Main St' 'street': 'Main St'
}, },
'admin1': 'Dungannon', 'parent': {
'alpha3': 'GBR', 'region': 'Dungannon',
'admin0': 'United Kingdom' 'country_a': 'GBR',
'country': 'United Kingdom'
}
}; };
var deAddress = { var deAddress = {
@ -30,12 +32,14 @@ module.exports.tests.flipNumberAndStreet = function(test, common) {
'number': '23', 'number': '23',
'street': 'Grolmanstraße' 'street': 'Grolmanstraße'
}, },
'admin1': 'Berlin', 'parent': {
'locality': 'Berlin', 'region': 'Berlin',
'alpha3': 'DEU', 'locality': 'Berlin',
'admin2': 'Berlin', 'country_a': 'DEU',
'admin0': 'Germany', 'county': 'Berlin',
'neighborhood': 'Hansaviertel' 'country': 'Germany',
'neighbourhood': 'Hansaviertel'
}
}; };
var req = {}, var req = {},

Loading…
Cancel
Save