|
|
|
@ -30,7 +30,7 @@ module.exports.tests.should_execute = (test, common) => {
|
|
|
|
|
return false; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const controller = placeholder(placeholder_service, should_execute); |
|
|
|
|
const controller = placeholder(placeholder_service, true, should_execute); |
|
|
|
|
|
|
|
|
|
const req = { a: 1 }; |
|
|
|
|
const res = { b: 2 }; |
|
|
|
@ -52,7 +52,7 @@ module.exports.tests.should_execute = (test, common) => {
|
|
|
|
|
callback(null, []); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const controller = placeholder(placeholder_service, _.constant(true)); |
|
|
|
|
const controller = placeholder(placeholder_service, true, () => true); |
|
|
|
|
|
|
|
|
|
const req = { param1: 'param1 value' }; |
|
|
|
|
const res = { b: 2 }; |
|
|
|
@ -206,7 +206,7 @@ module.exports.tests.success = (test, common) => {
|
|
|
|
|
|
|
|
|
|
const controller = proxyquire('../../../controller/placeholder', { |
|
|
|
|
'pelias-logger': logger |
|
|
|
|
})(placeholder_service, _.constant(true)); |
|
|
|
|
})(placeholder_service, true, () => true); |
|
|
|
|
|
|
|
|
|
const req = { param1: 'param1 value' }; |
|
|
|
|
const res = { }; |
|
|
|
@ -324,7 +324,7 @@ module.exports.tests.success = (test, common) => {
|
|
|
|
|
|
|
|
|
|
const controller = proxyquire('../../../controller/placeholder', { |
|
|
|
|
'pelias-logger': logger |
|
|
|
|
})(placeholder_service, _.constant(true)); |
|
|
|
|
})(placeholder_service, true, () => true); |
|
|
|
|
|
|
|
|
|
const req = { param1: 'param1 value' }; |
|
|
|
|
const res = { }; |
|
|
|
@ -387,7 +387,7 @@ module.exports.tests.success = (test, common) => {
|
|
|
|
|
|
|
|
|
|
const controller = proxyquire('../../../controller/placeholder', { |
|
|
|
|
'pelias-logger': logger |
|
|
|
|
})(placeholder_service, _.constant(true)); |
|
|
|
|
})(placeholder_service, true, () => true); |
|
|
|
|
|
|
|
|
|
const req = { param1: 'param1 value' }; |
|
|
|
|
const res = { }; |
|
|
|
@ -447,7 +447,7 @@ module.exports.tests.success = (test, common) => {
|
|
|
|
|
|
|
|
|
|
const controller = proxyquire('../../../controller/placeholder', { |
|
|
|
|
'pelias-logger': logger |
|
|
|
|
})(placeholder_service, _.constant(true)); |
|
|
|
|
})(placeholder_service, true, () => true); |
|
|
|
|
|
|
|
|
|
const req = { param1: 'param1 value' }; |
|
|
|
|
const res = { }; |
|
|
|
@ -512,7 +512,7 @@ module.exports.tests.success = (test, common) => {
|
|
|
|
|
|
|
|
|
|
const controller = proxyquire('../../../controller/placeholder', { |
|
|
|
|
'pelias-logger': logger |
|
|
|
|
})(placeholder_service, _.constant(true)); |
|
|
|
|
})(placeholder_service, true, () => true); |
|
|
|
|
|
|
|
|
|
const req = { param1: 'param1 value' }; |
|
|
|
|
const res = { }; |
|
|
|
@ -577,7 +577,7 @@ module.exports.tests.success = (test, common) => {
|
|
|
|
|
|
|
|
|
|
const controller = proxyquire('../../../controller/placeholder', { |
|
|
|
|
'pelias-logger': logger |
|
|
|
|
})(placeholder_service, _.constant(true)); |
|
|
|
|
})(placeholder_service, true, () => true); |
|
|
|
|
|
|
|
|
|
const req = { param1: 'param1 value' }; |
|
|
|
|
const res = { }; |
|
|
|
@ -742,7 +742,7 @@ module.exports.tests.result_filtering = (test, common) => {
|
|
|
|
|
|
|
|
|
|
const controller = proxyquire('../../../controller/placeholder', { |
|
|
|
|
'pelias-logger': logger |
|
|
|
|
})(placeholder_service, _.constant(true)); |
|
|
|
|
})(placeholder_service, true, () => true); |
|
|
|
|
|
|
|
|
|
const req = { |
|
|
|
|
param1: 'param1 value', |
|
|
|
@ -804,6 +804,141 @@ module.exports.tests.result_filtering = (test, common) => {
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
test('when geometric_filters_apply is false, boundary.rect should not apply', (t) => { |
|
|
|
|
const logger = require('pelias-mock-logger')(); |
|
|
|
|
|
|
|
|
|
const placeholder_service = (req, callback) => { |
|
|
|
|
t.deepEqual(req, { |
|
|
|
|
param1: 'param1 value', |
|
|
|
|
clean: { |
|
|
|
|
'boundary.rect.min_lat': -1, |
|
|
|
|
'boundary.rect.max_lat': 1, |
|
|
|
|
'boundary.rect.min_lon': -1, |
|
|
|
|
'boundary.rect.max_lon': 1 |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
const response = [ |
|
|
|
|
{ |
|
|
|
|
// inside bbox
|
|
|
|
|
id: 1, |
|
|
|
|
name: 'name 1', |
|
|
|
|
placetype: 'neighbourhood', |
|
|
|
|
geom: { |
|
|
|
|
lat: 0, |
|
|
|
|
lon: 0 |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
// outside bbox
|
|
|
|
|
id: 2, |
|
|
|
|
name: 'name 2', |
|
|
|
|
placetype: 'neighbourhood', |
|
|
|
|
geom: { |
|
|
|
|
lat: -2, |
|
|
|
|
lon: 2 |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
// outside bbox
|
|
|
|
|
id: 3, |
|
|
|
|
name: 'name 3', |
|
|
|
|
placetype: 'neighbourhood', |
|
|
|
|
geom: { |
|
|
|
|
lat: 2, |
|
|
|
|
lon: -2 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
callback(null, response); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const should_execute = (req, res) => { |
|
|
|
|
return true; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const controller = proxyquire('../../../controller/placeholder', { |
|
|
|
|
'pelias-logger': logger |
|
|
|
|
})(placeholder_service, false, () => true); |
|
|
|
|
|
|
|
|
|
const req = { |
|
|
|
|
param1: 'param1 value', |
|
|
|
|
clean: { |
|
|
|
|
'boundary.rect.min_lat': -1, |
|
|
|
|
'boundary.rect.max_lat': 1, |
|
|
|
|
'boundary.rect.min_lon': -1, |
|
|
|
|
'boundary.rect.max_lon': 1 |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
const res = { }; |
|
|
|
|
|
|
|
|
|
controller(req, res, () => { |
|
|
|
|
const expected_res = { |
|
|
|
|
meta: { |
|
|
|
|
query_type: 'fallback' |
|
|
|
|
}, |
|
|
|
|
data: [ |
|
|
|
|
{ |
|
|
|
|
_id: '1', |
|
|
|
|
_type: 'neighbourhood', |
|
|
|
|
layer: 'neighbourhood', |
|
|
|
|
source: 'whosonfirst', |
|
|
|
|
source_id: '1', |
|
|
|
|
center_point: { |
|
|
|
|
lat: 0, |
|
|
|
|
lon: 0 |
|
|
|
|
}, |
|
|
|
|
name: { |
|
|
|
|
'default': 'name 1' |
|
|
|
|
}, |
|
|
|
|
phrase: { |
|
|
|
|
'default': 'name 1' |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
_id: '2', |
|
|
|
|
_type: 'neighbourhood', |
|
|
|
|
layer: 'neighbourhood', |
|
|
|
|
source: 'whosonfirst', |
|
|
|
|
source_id: '2', |
|
|
|
|
center_point: { |
|
|
|
|
lat: -2, |
|
|
|
|
lon: 2 |
|
|
|
|
}, |
|
|
|
|
name: { |
|
|
|
|
'default': 'name 2' |
|
|
|
|
}, |
|
|
|
|
phrase: { |
|
|
|
|
'default': 'name 2' |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
_id: '3', |
|
|
|
|
_type: 'neighbourhood', |
|
|
|
|
layer: 'neighbourhood', |
|
|
|
|
source: 'whosonfirst', |
|
|
|
|
source_id: '3', |
|
|
|
|
center_point: { |
|
|
|
|
lat: 2, |
|
|
|
|
lon: -2 |
|
|
|
|
}, |
|
|
|
|
name: { |
|
|
|
|
'default': 'name 3' |
|
|
|
|
}, |
|
|
|
|
phrase: { |
|
|
|
|
'default': 'name 3' |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
t.deepEquals(res, expected_res); |
|
|
|
|
t.end(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
test('when boundary.circle is available, results outside of it should be removed', (t) => { |
|
|
|
|
const logger = require('pelias-mock-logger')(); |
|
|
|
|
|
|
|
|
@ -927,7 +1062,7 @@ module.exports.tests.result_filtering = (test, common) => {
|
|
|
|
|
|
|
|
|
|
const controller = proxyquire('../../../controller/placeholder', { |
|
|
|
|
'pelias-logger': logger |
|
|
|
|
})(placeholder_service, _.constant(true)); |
|
|
|
|
})(placeholder_service, true, () => true); |
|
|
|
|
|
|
|
|
|
const req = { |
|
|
|
|
param1: 'param1 value', |
|
|
|
@ -988,6 +1123,139 @@ module.exports.tests.result_filtering = (test, common) => {
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
test('when geometric_filters_apply is false, boundary.circle should not apply', (t) => { |
|
|
|
|
const logger = require('pelias-mock-logger')(); |
|
|
|
|
|
|
|
|
|
const placeholder_service = (req, callback) => { |
|
|
|
|
t.deepEqual(req, { |
|
|
|
|
param1: 'param1 value', |
|
|
|
|
clean: { |
|
|
|
|
'boundary.circle.lat': 0, |
|
|
|
|
'boundary.circle.lon': 0, |
|
|
|
|
'boundary.circle.radius': 500 |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
const response = [ |
|
|
|
|
{ |
|
|
|
|
// inside circle
|
|
|
|
|
id: 1, |
|
|
|
|
name: 'name 1', |
|
|
|
|
placetype: 'neighbourhood', |
|
|
|
|
geom: { |
|
|
|
|
lat: 1, |
|
|
|
|
lon: 1 |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
// outside circle on +lon
|
|
|
|
|
id: 2, |
|
|
|
|
name: 'name 2', |
|
|
|
|
placetype: 'neighbourhood', |
|
|
|
|
geom: { |
|
|
|
|
lat: -45, |
|
|
|
|
lon: 45 |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
// outside bbox on +lat
|
|
|
|
|
id: 3, |
|
|
|
|
name: 'name 3', |
|
|
|
|
placetype: 'neighbourhood', |
|
|
|
|
geom: { |
|
|
|
|
lat: 45, |
|
|
|
|
lon: -45 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
callback(null, response); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const should_execute = (req, res) => { |
|
|
|
|
return true; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const controller = proxyquire('../../../controller/placeholder', { |
|
|
|
|
'pelias-logger': logger |
|
|
|
|
})(placeholder_service, false, () => true); |
|
|
|
|
|
|
|
|
|
const req = { |
|
|
|
|
param1: 'param1 value', |
|
|
|
|
clean: { |
|
|
|
|
'boundary.circle.lat': 0, |
|
|
|
|
'boundary.circle.lon': 0, |
|
|
|
|
'boundary.circle.radius': 500 |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
const res = { }; |
|
|
|
|
|
|
|
|
|
controller(req, res, () => { |
|
|
|
|
const expected_res = { |
|
|
|
|
meta: { |
|
|
|
|
query_type: 'fallback' |
|
|
|
|
}, |
|
|
|
|
data: [ |
|
|
|
|
{ |
|
|
|
|
_id: '1', |
|
|
|
|
_type: 'neighbourhood', |
|
|
|
|
layer: 'neighbourhood', |
|
|
|
|
source: 'whosonfirst', |
|
|
|
|
source_id: '1', |
|
|
|
|
center_point: { |
|
|
|
|
lat: 1, |
|
|
|
|
lon: 1 |
|
|
|
|
}, |
|
|
|
|
name: { |
|
|
|
|
'default': 'name 1' |
|
|
|
|
}, |
|
|
|
|
phrase: { |
|
|
|
|
'default': 'name 1' |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
_id: '2', |
|
|
|
|
_type: 'neighbourhood', |
|
|
|
|
layer: 'neighbourhood', |
|
|
|
|
source: 'whosonfirst', |
|
|
|
|
source_id: '2', |
|
|
|
|
center_point: { |
|
|
|
|
lat: -45, |
|
|
|
|
lon: 45 |
|
|
|
|
}, |
|
|
|
|
name: { |
|
|
|
|
'default': 'name 2' |
|
|
|
|
}, |
|
|
|
|
phrase: { |
|
|
|
|
'default': 'name 2' |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
_id: '3', |
|
|
|
|
_type: 'neighbourhood', |
|
|
|
|
layer: 'neighbourhood', |
|
|
|
|
source: 'whosonfirst', |
|
|
|
|
source_id: '3', |
|
|
|
|
center_point: { |
|
|
|
|
lat: 45, |
|
|
|
|
lon: -45 |
|
|
|
|
}, |
|
|
|
|
name: { |
|
|
|
|
'default': 'name 3' |
|
|
|
|
}, |
|
|
|
|
phrase: { |
|
|
|
|
'default': 'name 3' |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
t.deepEquals(res, expected_res); |
|
|
|
|
t.end(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
test('only results matching explicit layers should be returned', (t) => { |
|
|
|
|
const logger = mock_logger(); |
|
|
|
|
|
|
|
|
@ -1062,7 +1330,7 @@ module.exports.tests.result_filtering = (test, common) => {
|
|
|
|
|
|
|
|
|
|
const controller = proxyquire('../../../controller/placeholder', { |
|
|
|
|
'pelias-logger': logger |
|
|
|
|
})(placeholder_service, _.constant(true)); |
|
|
|
|
})(placeholder_service, true, () => true); |
|
|
|
|
|
|
|
|
|
const req = { |
|
|
|
|
param1: 'param1 value', |
|
|
|
@ -1198,7 +1466,7 @@ module.exports.tests.result_filtering = (test, common) => {
|
|
|
|
|
|
|
|
|
|
const controller = proxyquire('../../../controller/placeholder', { |
|
|
|
|
'pelias-logger': logger |
|
|
|
|
})(placeholder_service, _.constant(true)); |
|
|
|
|
})(placeholder_service, true, () => true); |
|
|
|
|
|
|
|
|
|
const req = { |
|
|
|
|
param1: 'param1 value', |
|
|
|
@ -1350,7 +1618,7 @@ module.exports.tests.result_filtering = (test, common) => {
|
|
|
|
|
|
|
|
|
|
const controller = proxyquire('../../../controller/placeholder', { |
|
|
|
|
'pelias-logger': logger |
|
|
|
|
})(placeholder_service, _.constant(true)); |
|
|
|
|
})(placeholder_service, true, () => true); |
|
|
|
|
|
|
|
|
|
const req = { |
|
|
|
|
param1: 'param1 value', |
|
|
|
@ -1420,6 +1688,178 @@ module.exports.tests.result_filtering = (test, common) => {
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
test('when geometric_filters_apply is false, boundary.country should not apply', (t) => { |
|
|
|
|
const logger = require('pelias-mock-logger')(); |
|
|
|
|
|
|
|
|
|
const placeholder_service = (req, callback) => { |
|
|
|
|
t.deepEqual(req, { |
|
|
|
|
param1: 'param1 value', |
|
|
|
|
clean: { |
|
|
|
|
'boundary.country': 'ABC' |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
const response = [ |
|
|
|
|
{ |
|
|
|
|
id: 1, |
|
|
|
|
name: 'name 1', |
|
|
|
|
placetype: 'locality', |
|
|
|
|
lineage: [ |
|
|
|
|
{ |
|
|
|
|
country: { |
|
|
|
|
id: 1, |
|
|
|
|
name: 'country name 1', |
|
|
|
|
abbr: 'ABC' |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
country: { |
|
|
|
|
id: 2, |
|
|
|
|
name: 'country name 2', |
|
|
|
|
abbr: 'DEF' |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
geom: { |
|
|
|
|
lat: 14.141414, |
|
|
|
|
lon: 41.414141 |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 3, |
|
|
|
|
name: 'name 3', |
|
|
|
|
placetype: 'locality', |
|
|
|
|
lineage: [ |
|
|
|
|
{ |
|
|
|
|
country: { |
|
|
|
|
id: 3, |
|
|
|
|
name: 'country name 3', |
|
|
|
|
abbr: 'ABC' |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
geom: { |
|
|
|
|
lat: 15.151515, |
|
|
|
|
lon: 51.515151 |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
id: 4, |
|
|
|
|
name: 'name 4', |
|
|
|
|
placetype: 'locality', |
|
|
|
|
lineage: [ |
|
|
|
|
{ |
|
|
|
|
country: { |
|
|
|
|
id: 4, |
|
|
|
|
name: 'country name 4', |
|
|
|
|
abbr: 'GHI' |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
], |
|
|
|
|
geom: { |
|
|
|
|
lat: 16.161616, |
|
|
|
|
lon: 61.616161 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
callback(null, response); |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const controller = proxyquire('../../../controller/placeholder', { |
|
|
|
|
'pelias-logger': logger |
|
|
|
|
})(placeholder_service, false, () => true); |
|
|
|
|
|
|
|
|
|
const req = { |
|
|
|
|
param1: 'param1 value', |
|
|
|
|
clean: { |
|
|
|
|
'boundary.country': 'ABC' |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
const res = { }; |
|
|
|
|
|
|
|
|
|
controller(req, res, () => { |
|
|
|
|
const expected_res = { |
|
|
|
|
meta: { |
|
|
|
|
query_type: 'fallback' |
|
|
|
|
}, |
|
|
|
|
data: [ |
|
|
|
|
{ |
|
|
|
|
_id: '1', |
|
|
|
|
_type: 'locality', |
|
|
|
|
layer: 'locality', |
|
|
|
|
source: 'whosonfirst', |
|
|
|
|
source_id: '1', |
|
|
|
|
center_point: { |
|
|
|
|
lat: 14.141414, |
|
|
|
|
lon: 41.414141 |
|
|
|
|
}, |
|
|
|
|
name: { |
|
|
|
|
'default': 'name 1' |
|
|
|
|
}, |
|
|
|
|
phrase: { |
|
|
|
|
'default': 'name 1' |
|
|
|
|
}, |
|
|
|
|
parent: { |
|
|
|
|
country: ['country name 1', 'country name 2'], |
|
|
|
|
country_id: ['1', '2'], |
|
|
|
|
country_a: ['ABC', 'DEF'] |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
_id: '3', |
|
|
|
|
_type: 'locality', |
|
|
|
|
layer: 'locality', |
|
|
|
|
source: 'whosonfirst', |
|
|
|
|
source_id: '3', |
|
|
|
|
center_point: { |
|
|
|
|
lat: 15.151515, |
|
|
|
|
lon: 51.515151 |
|
|
|
|
}, |
|
|
|
|
name: { |
|
|
|
|
'default': 'name 3' |
|
|
|
|
}, |
|
|
|
|
phrase: { |
|
|
|
|
'default': 'name 3' |
|
|
|
|
}, |
|
|
|
|
parent: { |
|
|
|
|
country: ['country name 3'], |
|
|
|
|
country_id: ['3'], |
|
|
|
|
country_a: ['ABC'] |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
_id: '4', |
|
|
|
|
_type: 'locality', |
|
|
|
|
layer: 'locality', |
|
|
|
|
source: 'whosonfirst', |
|
|
|
|
source_id: '4', |
|
|
|
|
center_point: { |
|
|
|
|
lat: 16.161616, |
|
|
|
|
lon: 61.616161 |
|
|
|
|
}, |
|
|
|
|
name: { |
|
|
|
|
'default': 'name 4' |
|
|
|
|
}, |
|
|
|
|
phrase: { |
|
|
|
|
'default': 'name 4' |
|
|
|
|
}, |
|
|
|
|
parent: { |
|
|
|
|
country: ['country name 4'], |
|
|
|
|
country_id: ['4'], |
|
|
|
|
country_a: ['GHI'] |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
] |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
t.deepEquals(res, expected_res); |
|
|
|
|
t.ok(logger.isInfoMessage('[controller:placeholder] [result_count:3]')); |
|
|
|
|
t.end(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
module.exports.tests.lineage_errors = (test, common) => { |
|
|
|
@ -1460,7 +1900,7 @@ module.exports.tests.lineage_errors = (test, common) => {
|
|
|
|
|
|
|
|
|
|
const controller = proxyquire('../../../controller/placeholder', { |
|
|
|
|
'pelias-logger': logger |
|
|
|
|
})(placeholder_service, _.constant(true)); |
|
|
|
|
})(placeholder_service, true, () => true); |
|
|
|
|
|
|
|
|
|
const req = { param1: 'param1 value' }; |
|
|
|
|
const res = { }; |
|
|
|
@ -1534,7 +1974,7 @@ module.exports.tests.lineage_errors = (test, common) => {
|
|
|
|
|
|
|
|
|
|
const controller = proxyquire('../../../controller/placeholder', { |
|
|
|
|
'pelias-logger': logger |
|
|
|
|
})(placeholder_service, _.constant(true)); |
|
|
|
|
})(placeholder_service, true, () => true); |
|
|
|
|
|
|
|
|
|
const req = { param1: 'param1 value' }; |
|
|
|
|
const res = { }; |
|
|
|
@ -1607,7 +2047,7 @@ module.exports.tests.lineage_errors = (test, common) => {
|
|
|
|
|
|
|
|
|
|
const controller = proxyquire('../../../controller/placeholder', { |
|
|
|
|
'pelias-logger': logger |
|
|
|
|
})(placeholder_service, _.constant(true)); |
|
|
|
|
})(placeholder_service, true, () => true); |
|
|
|
|
|
|
|
|
|
const req = { param1: 'param1 value' }; |
|
|
|
|
const res = { }; |
|
|
|
@ -1667,7 +2107,7 @@ module.exports.tests.geometry_errors = (test, common) => {
|
|
|
|
|
|
|
|
|
|
const controller = proxyquire('../../../controller/placeholder', { |
|
|
|
|
'pelias-logger': logger |
|
|
|
|
})(placeholder_service, _.constant(true)); |
|
|
|
|
})(placeholder_service, true, () => true); |
|
|
|
|
|
|
|
|
|
const req = { param1: 'param1 value' }; |
|
|
|
|
const res = { }; |
|
|
|
@ -1726,7 +2166,7 @@ module.exports.tests.centroid_errors = (test, common) => {
|
|
|
|
|
|
|
|
|
|
const controller = proxyquire('../../../controller/placeholder', { |
|
|
|
|
'pelias-logger': logger |
|
|
|
|
})(placeholder_service, _.constant(true)); |
|
|
|
|
})(placeholder_service, true, () => true); |
|
|
|
|
|
|
|
|
|
const req = { param1: 'param1 value' }; |
|
|
|
|
const res = { }; |
|
|
|
@ -1786,7 +2226,7 @@ module.exports.tests.centroid_errors = (test, common) => {
|
|
|
|
|
|
|
|
|
|
const controller = proxyquire('../../../controller/placeholder', { |
|
|
|
|
'pelias-logger': logger |
|
|
|
|
})(placeholder_service, _.constant(true)); |
|
|
|
|
})(placeholder_service, true, () => true); |
|
|
|
|
|
|
|
|
|
const req = { param1: 'param1 value' }; |
|
|
|
|
const res = { }; |
|
|
|
@ -1856,7 +2296,7 @@ module.exports.tests.boundingbox_errors = (test, common) => {
|
|
|
|
|
|
|
|
|
|
const controller = proxyquire('../../../controller/placeholder', { |
|
|
|
|
'pelias-logger': logger |
|
|
|
|
})(placeholder_service, _.constant(true)); |
|
|
|
|
})(placeholder_service, true, () => true); |
|
|
|
|
|
|
|
|
|
const req = { param1: 'param1 value' }; |
|
|
|
|
const res = { }; |
|
|
|
@ -1908,7 +2348,7 @@ module.exports.tests.error_conditions = (test, common) => {
|
|
|
|
|
|
|
|
|
|
const controller = proxyquire('../../../controller/placeholder', { |
|
|
|
|
'pelias-logger': logger |
|
|
|
|
})(placeholder_service, _.constant(true)); |
|
|
|
|
})(placeholder_service, true, () => true); |
|
|
|
|
|
|
|
|
|
const req = { |
|
|
|
|
errors: [] |
|
|
|
@ -1937,7 +2377,7 @@ module.exports.tests.error_conditions = (test, common) => {
|
|
|
|
|
|
|
|
|
|
const controller = proxyquire('../../../controller/placeholder', { |
|
|
|
|
'pelias-logger': logger |
|
|
|
|
})(placeholder_service, _.constant(true)); |
|
|
|
|
})(placeholder_service, true, () => true); |
|
|
|
|
|
|
|
|
|
const req = { |
|
|
|
|
errors: [] |
|
|
|
@ -1962,7 +2402,7 @@ module.exports.tests.error_conditions = (test, common) => {
|
|
|
|
|
|
|
|
|
|
const controller = proxyquire('../../../controller/placeholder', { |
|
|
|
|
'pelias-logger': logger |
|
|
|
|
})(placeholder_service, _.constant(true)); |
|
|
|
|
})(placeholder_service, true, () => true); |
|
|
|
|
|
|
|
|
|
const req = { |
|
|
|
|
errors: [] |
|
|
|
|