journeys: add journey.type 🐛

To make it FPTF-compliant.
This commit is contained in:
Jannis R 2018-03-02 00:35:54 +01:00
parent ab80e81ccc
commit fd8eb92806
No known key found for this signature in database
GPG key ID: 0FE83946296A88A5
4 changed files with 7 additions and 0 deletions

View file

@ -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,

View file

@ -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))) {

View file

@ -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

View file

@ -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)