Skip to content

Commit

Permalink
adds sample minimised result for reference #84
Browse files Browse the repository at this point in the history
  • Loading branch information
nelsonic committed Jun 7, 2016
1 parent d7f0925 commit 3b1cfab
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/result_mapper.test.js
Expand Up @@ -107,8 +107,8 @@ describe('Format result for client (reduce amount of data sent)', function () {
assert.equal(min.packageOffer.hotel.images.small.length, 1, 'only one small image returned to client');
assert.deepEqual(item.concept, min.concept);
// save sample result
fs.writeFileSync(__dirname + '/sample_results/minimal_package.json',
JSON.stringify(result, null, 2)); // save sample result for reference
fs.writeFileSync(__dirname + '/sample_results/minified_package.json',
JSON.stringify(min, null, 2)); // save sample result for reference
// outcome
var itemLength = JSON.stringify(item).length;
var minlength = JSON.stringify(min).length;
Expand Down
76 changes: 76 additions & 0 deletions test/sample_results/minified_package.json
@@ -0,0 +1,76 @@
{
"type": "package",
"id": "HKTANAN",
"url": "/123456/HKTANAN",
"packageOffer": {
"hotel": {
"name": "Anan House",
"images": {
"small": [
{
"type": "image/jpeg",
"displaySequence": null,
"primary": null,
"uri": "http://images1.spies.dk/images/Hotel/HKTANAN1011_1_13.jpg?v=1"
}
]
}
},
"flights": {
"outbound": [
{
"number": "na",
"departure": {
"localDateTime": "2016-12-13T16:10:00",
"airport": {
"code": "CPH",
"name": "Kastrup Terminal 2"
}
},
"arrival": {
"localDateTime": "2016-12-14T08:50:00",
"airport": {
"code": "HKT"
}
},
"carrier": {
"code": "DK"
}
}
],
"inbound": [
{
"number": "na",
"departure": {
"localDateTime": "2017-01-03T11:00:00",
"airport": {
"code": "HKT",
"name": "Phuket"
}
},
"arrival": {
"localDateTime": "2017-01-04T17:05:00",
"airport": {
"code": "CPH"
}
},
"carrier": {
"code": "DK"
}
}
]
},
"price": {
"total": 79855,
"perPerson": 16094,
"currency": "DKK",
"discountPrice": 0
},
"provider": {
"id": "lambda-searcher",
"reference": "HKTANAN",
"deepLink": "http://www.spies.dk/redir/BookRedirect.aspx?departureDate=2016-12-13&duration=22&departureCode=CPH&destinationCode=HKT&transportSerial=21&transportClass=R&hotelCode=ANAN&roomType=H12"
},
"nights": 21
}
}

0 comments on commit 3b1cfab

Please sign in to comment.