From 447d0f74b9921620d38601db766655616cc8d88d Mon Sep 17 00:00:00 2001 From: Stephen Hess Date: Mon, 31 Jul 2017 11:25:13 -0400 Subject: [PATCH] don't serialize input:layers when passing to query --- query/address_search_using_ids.js | 2 +- test/unit/query/address_search_using_ids.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/query/address_search_using_ids.js b/query/address_search_using_ids.js index d7e2d1fd..a22cb917 100644 --- a/query/address_search_using_ids.js +++ b/query/address_search_using_ids.js @@ -131,7 +131,7 @@ function generateQuery( clean, res ){ // use an object here instead of calling `set` since that flattens out an // object into key/value pairs and makes identifying layers harder in query module - vs.var('input:layers', JSON.stringify(layers_to_ids)); + vs.var('input:layers', layers_to_ids); } diff --git a/test/unit/query/address_search_using_ids.js b/test/unit/query/address_search_using_ids.js index 665aa681..27ecb85f 100644 --- a/test/unit/query/address_search_using_ids.js +++ b/test/unit/query/address_search_using_ids.js @@ -251,7 +251,7 @@ module.exports.tests.granularity_bands = (test, common) => { const generatedQuery = generateQuery(clean, res); - t.deepEquals(JSON.parse(generatedQuery.body.vs.var('input:layers')), { + t.deepEquals(generatedQuery.body.vs.var('input:layers').$, { neighbourhood: [1, 11], borough: [2, 12], locality: [3, 13], @@ -296,7 +296,7 @@ module.exports.tests.granularity_bands = (test, common) => { const generatedQuery = generateQuery(clean, res); - t.deepEquals(JSON.parse(generatedQuery.body.vs.var('input:layers')), { + t.deepEquals(generatedQuery.body.vs.var('input:layers').$, { neighbourhood: [1], borough: [], locality: [], @@ -354,7 +354,7 @@ module.exports.tests.granularity_bands = (test, common) => { const generatedQuery = generateQuery(clean, res); - t.deepEquals(JSON.parse(generatedQuery.body.vs.var('input:layers')), { + t.deepEquals(generatedQuery.body.vs.var('input:layers').$, { county: [1, 4], macrocounty: [2, 5] });