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 e24a1ef8..1205b344 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)