Browse Source

Merge pull request #920 from pelias/staging

Merge staging into production
pull/1005/head
Julian Simioni 7 years ago committed by GitHub
parent
commit
ca562974d0
  1. 5
      controller/placeholder.js
  2. 68
      test/unit/controller/placeholder.js

5
controller/placeholder.js

@ -235,7 +235,10 @@ function setup(placeholderService, should_execute) {
// convert results to ES docs // convert results to ES docs
// boundary.country filter must happen after synthesis since multiple // boundary.country filter must happen after synthesis since multiple
// lineages may produce different country docs // lineages may produce different country docs
res.meta = {}; res.meta = {
query_type: 'fallback'
};
res.data = results res.data = results
// filter out results that don't have a name // filter out results that don't have a name
.filter(hasName) .filter(hasName)

68
test/unit/controller/placeholder.js

@ -213,7 +213,9 @@ module.exports.tests.success = (test, common) => {
controller(req, res, () => { controller(req, res, () => {
const expected_res = { const expected_res = {
meta: {}, meta: {
query_type: 'fallback'
},
data: [ data: [
{ {
_id: '123', _id: '123',
@ -330,7 +332,9 @@ module.exports.tests.success = (test, common) => {
controller(req, res, () => { controller(req, res, () => {
const expected_res = { const expected_res = {
meta: {}, meta: {
query_type: 'fallback'
},
data: [ data: [
{ {
_id: '123', _id: '123',
@ -392,7 +396,9 @@ module.exports.tests.success = (test, common) => {
controller(req, res, () => { controller(req, res, () => {
const expected_res = { const expected_res = {
meta: {}, meta: {
query_type: 'fallback'
},
data: [ data: [
{ {
_id: '123', _id: '123',
@ -451,7 +457,9 @@ module.exports.tests.success = (test, common) => {
controller(req, res, () => { controller(req, res, () => {
const expected_res = { const expected_res = {
meta: {}, meta: {
query_type: 'fallback'
},
data: [ data: [
{ {
_id: '123', _id: '123',
@ -515,7 +523,9 @@ module.exports.tests.success = (test, common) => {
controller(req, res, () => { controller(req, res, () => {
const expected_res = { const expected_res = {
meta: {}, meta: {
query_type: 'fallback'
},
data: [ data: [
{ {
_id: '456', _id: '456',
@ -579,7 +589,9 @@ module.exports.tests.success = (test, common) => {
controller(req, res, () => { controller(req, res, () => {
const expected_res = { const expected_res = {
meta: {}, meta: {
query_type: 'fallback'
},
data: [ data: [
{ {
_id: '1', _id: '1',
@ -751,7 +763,9 @@ module.exports.tests.result_filtering = (test, common) => {
controller(req, res, () => { controller(req, res, () => {
const expected_res = { const expected_res = {
meta: {}, meta: {
query_type: 'fallback'
},
data: [ data: [
{ {
_id: '1', _id: '1',
@ -935,7 +949,9 @@ module.exports.tests.result_filtering = (test, common) => {
controller(req, res, () => { controller(req, res, () => {
const expected_res = { const expected_res = {
meta: {}, meta: {
query_type: 'fallback'
},
data: [ data: [
{ {
_id: '1', _id: '1',
@ -1072,7 +1088,9 @@ module.exports.tests.result_filtering = (test, common) => {
controller(req, res, () => { controller(req, res, () => {
const expected_res = { const expected_res = {
meta: {}, meta: {
query_type: 'fallback'
},
data: [ data: [
{ {
_id: '1', _id: '1',
@ -1222,7 +1240,9 @@ module.exports.tests.result_filtering = (test, common) => {
controller(req, res, () => { controller(req, res, () => {
const expected_res = { const expected_res = {
meta: {}, meta: {
query_type: 'fallback'
},
data: [ data: [
{ {
_id: '1', _id: '1',
@ -1325,7 +1345,9 @@ module.exports.tests.lineage_errors = (test, common) => {
controller(req, res, () => { controller(req, res, () => {
const expected_res = { const expected_res = {
meta: {}, meta: {
query_type: 'fallback'
},
data: [ data: [
{ {
_id: '123', _id: '123',
@ -1397,7 +1419,9 @@ module.exports.tests.lineage_errors = (test, common) => {
controller(req, res, () => { controller(req, res, () => {
const expected_res = { const expected_res = {
meta: {}, meta: {
query_type: 'fallback'
},
data: [ data: [
{ {
_id: '123', _id: '123',
@ -1468,7 +1492,9 @@ module.exports.tests.lineage_errors = (test, common) => {
controller(req, res, () => { controller(req, res, () => {
const expected_res = { const expected_res = {
meta: {}, meta: {
query_type: 'fallback'
},
data: [ data: [
{ {
_id: '123', _id: '123',
@ -1526,7 +1552,9 @@ module.exports.tests.geometry_errors = (test, common) => {
controller(req, res, () => { controller(req, res, () => {
const expected_res = { const expected_res = {
meta: {}, meta: {
query_type: 'fallback'
},
data: [ data: [
{ {
_id: '123', _id: '123',
@ -1584,7 +1612,9 @@ module.exports.tests.centroid_errors = (test, common) => {
controller(req, res, () => { controller(req, res, () => {
const expected_res = { const expected_res = {
meta: {}, meta: {
query_type: 'fallback'
},
data: [ data: [
{ {
_id: '123', _id: '123',
@ -1643,7 +1673,9 @@ module.exports.tests.centroid_errors = (test, common) => {
controller(req, res, () => { controller(req, res, () => {
const expected_res = { const expected_res = {
meta: {}, meta: {
query_type: 'fallback'
},
data: [ data: [
{ {
_id: '123', _id: '123',
@ -1712,7 +1744,9 @@ module.exports.tests.boundingbox_errors = (test, common) => {
controller(req, res, () => { controller(req, res, () => {
const expected_res = { const expected_res = {
meta: {}, meta: {
query_type: 'fallback'
},
data: [ data: [
{ {
_id: '123', _id: '123',

Loading…
Cancel
Save