Skip to content

Commit

Permalink
added address parts and categories to test
Browse files Browse the repository at this point in the history
  • Loading branch information
trescube committed Jul 7, 2017
1 parent 87c9ef0 commit 32710cc
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion test/document/toESDocument.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ module.exports.tests.toESDocument = function(test) {

var doc = new Document('mysource','mylayer','myid');
doc.setName('myprop', 'myname');
doc.setAddress('name', 'address name');
doc.setAddress('number', 'address number');
doc.setAddress('street', 'address street');
doc.setAddress('zip', 'address zip');
doc.setBoundingBox({
upperLeft: {
lat: 13.131313,
Expand All @@ -34,6 +38,8 @@ module.exports.tests.toESDocument = function(test) {
doc.setPopulation(123);
doc.setPopularity(456);
doc.setPolygon({ key: 'value' });
doc.addCategory('category 1');
doc.addCategory('category 2');

var esDoc = doc.toESDocument();

Expand All @@ -49,12 +55,24 @@ module.exports.tests.toESDocument = function(test) {
phrase: {
myprop: 'myname'
},
address_parts: {
name: 'address name',
number: 'address number',
street: 'address street',
zip: 'address zip'
},
source: 'mysource',
source_id: 'myid',
bounding_box: '{"min_lat":12.121212,"max_lat":13.131313,"min_lon":21.212121,"max_lon":31.313131}',
population: 123,
popularity: 456,
polygon: { key: 'value' }
polygon: {
key: 'value'
},
category: [
'category 1',
'category 2'
]
}
};

Expand Down

0 comments on commit 32710cc

Please sign in to comment.