From fd8eb92806cd2fcb58bc61364f30d3cfc0af082d Mon Sep 17 00:00:00 2001 From: Jannis R Date: Fri, 2 Mar 2018 00:35:54 +0100 Subject: [PATCH] journeys: add journey.type :bug: To make it FPTF-compliant. --- parse/journey.js | 1 + test/db.js | 2 ++ test/oebb.js | 2 ++ test/vbb.js | 2 ++ 4 files changed, 7 insertions(+) diff --git a/parse/journey.js b/parse/journey.js index 2463c114..340991f4 100644 --- a/parse/journey.js +++ b/parse/journey.js @@ -14,6 +14,7 @@ const createParseJourney = (profile, stations, lines, remarks) => { const parseJourney = (j) => { const legs = j.secL.map(leg => parseLeg(j, leg)) const res = { + type: 'journey', legs, origin: legs[0].origin, destination: legs[legs.length - 1].destination, diff --git a/test/db.js b/test/db.js index d8a7d640..17b1a140 100644 --- a/test/db.js +++ b/test/db.js @@ -100,6 +100,8 @@ test('Berlin Jungfernheide to München Hbf', co(function* (t) { t.ok(Array.isArray(journeys)) t.ok(journeys.length > 0, 'no journeys') for (let journey of journeys) { + t.equal(journey.type, 'journey') + assertValidStation(t, journey.origin) assertValidStationProducts(t, journey.origin.products) if (!(yield findStation(journey.origin.id))) { diff --git a/test/oebb.js b/test/oebb.js index 90a7b350..31ba75d4 100644 --- a/test/oebb.js +++ b/test/oebb.js @@ -120,6 +120,8 @@ test('Salzburg Hbf to Wien Westbahnhof', co(function* (t) { t.ok(Array.isArray(journeys)) t.ok(journeys.length > 0, 'no journeys') for (let journey of journeys) { + t.equal(journey.type, 'journey') + assertValidStation(t, journey.origin) assertValidStationProducts(t, journey.origin.products) // todo diff --git a/test/vbb.js b/test/vbb.js index 8d562c81..318cb9ad 100644 --- a/test/vbb.js +++ b/test/vbb.js @@ -67,6 +67,8 @@ test('journeys – station to station', co(function* (t) { t.strictEqual(journeys.length, 3) for (let journey of journeys) { + t.equal(journey.type, 'journey') + assertValidStation(t, journey.origin) assertValidStationProducts(t, journey.origin.products) t.ok(journey.origin.name.indexOf('(Berlin)') === -1)