diff --git a/test/bvg.js b/test/bvg.js index aa628e49..421e734d 100644 --- a/test/bvg.js +++ b/test/bvg.js @@ -171,9 +171,9 @@ test('trip details', async (t) => { }) const p = journeys[0].legs[0] - t.ok(p.id, 'precondition failed') + t.ok(p.tripId, 'precondition failed') t.ok(p.line.name, 'precondition failed') - const trip = await client.trip(p.id, p.line.name, {when}) + const trip = await client.trip(p.tripId, p.line.name, {when}) validate(t, trip, 'trip', 'trip') t.end() diff --git a/test/cmta.js b/test/cmta.js index 43ec5383..d682482e 100644 --- a/test/cmta.js +++ b/test/cmta.js @@ -153,9 +153,9 @@ test('trip details', async (t) => { }) const p = journeys[0].legs[0] - t.ok(p.id, 'precondition failed') + t.ok(p.tripId, 'precondition failed') t.ok(p.line.name, 'precondition failed') - const trip = await client.trip(p.id, p.line.name, {when}) + const trip = await client.trip(p.tripId, p.line.name, {when}) validate(t, trip, 'trip', 'trip') t.end() diff --git a/test/db.js b/test/db.js index e307a193..413eb470 100644 --- a/test/db.js +++ b/test/db.js @@ -231,9 +231,9 @@ test('trip details', async (t) => { }) const p = journeys[0].legs[0] - t.ok(p.id, 'precondition failed') + t.ok(p.tripId, 'precondition failed') t.ok(p.line.name, 'precondition failed') - const trip = await client.trip(p.id, p.line.name, {when}) + const trip = await client.trip(p.tripId, p.line.name, {when}) const validateTrip = createValidateTrip(cfg) const validate = createValidate(cfg, { diff --git a/test/insa.js b/test/insa.js index f5e5ede8..adcb9eb3 100644 --- a/test/insa.js +++ b/test/insa.js @@ -164,9 +164,9 @@ test('trip details', async (t) => { }) const p = journeys[0].legs[0] - t.ok(p.id, 'precondition failed') + t.ok(p.tripId, 'precondition failed') t.ok(p.line.name, 'precondition failed') - const trip = await client.trip(p.id, p.line.name, {when}) + const trip = await client.trip(p.tripId, p.line.name, {when}) validate(t, trip, 'trip', 'trip') t.end() diff --git a/test/lib/validators.js b/test/lib/validators.js index a80d8ab5..eedfbe68 100644 --- a/test/lib/validators.js +++ b/test/lib/validators.js @@ -305,7 +305,11 @@ const validateJourneys = (val, js, name = 'journeys') => { } const validateTrip = (val, trip, name = 'trip') => { - val.journeyLeg(val, trip, name) + const withFakeTripId = Object.assign({ + tripId: trip.id + }, trip) + delete withFakeTripId.id + val.journeyLeg(val, withFakeTripId, name) } const createValidateArrivalOrDeparture = (type, cfg) => { diff --git a/test/nahsh.js b/test/nahsh.js index 916f2ef6..baae8836 100644 --- a/test/nahsh.js +++ b/test/nahsh.js @@ -214,9 +214,9 @@ test('trip details', async (t) => { }) const p = journeys[0].legs[0] - t.ok(p.id, 'precondition failed') + t.ok(p.tripId, 'precondition failed') t.ok(p.line.name, 'precondition failed') - const trip = await client.trip(p.id, p.line.name, {when}) + const trip = await client.trip(p.tripId, p.line.name, {when}) validate(t, trip, 'trip', 'trip') t.end() diff --git a/test/oebb.js b/test/oebb.js index 073fc608..4fd5d142 100644 --- a/test/oebb.js +++ b/test/oebb.js @@ -237,9 +237,9 @@ test('trip details', async (t) => { }) const p = journeys[0].legs[0] - t.ok(p.id, 'precondition failed') + t.ok(p.tripId, 'precondition failed') t.ok(p.line.name, 'precondition failed') - const trip = await client.trip(p.id, p.line.name, {when}) + const trip = await client.trip(p.tripId, p.line.name, {when}) validate(t, trip, 'trip', 'trip') t.end() diff --git a/test/saarfahrplan.js b/test/saarfahrplan.js index 315c0bde..e5f63357 100644 --- a/test/saarfahrplan.js +++ b/test/saarfahrplan.js @@ -198,11 +198,11 @@ test('trip details', async (t) => { }) const p = journeys[0].legs[0] - t.ok(p.id, 'precondition failed') + t.ok(p.tripId, 'precondition failed') t.ok(p.line.name, 'precondition failed') - const trip = await client.trip(p.id, p.line.name, { when }) + const trip = await client.trip(p.tripId, p.line.name, { when }) - validate(t, trip, 'journeyLeg', 'trip') + validate(t, trip, 'trip', 'trip') t.end() }) diff --git a/test/sbahn-muenchen.js b/test/sbahn-muenchen.js index 11e798fa..dc09ba8b 100644 --- a/test/sbahn-muenchen.js +++ b/test/sbahn-muenchen.js @@ -167,9 +167,9 @@ test('trip details', async (t) => { }) const p = journeys[0].legs.find(leg => leg.line) - t.ok(p.id, 'precondition failed') + t.ok(p.tripId, 'precondition failed') t.ok(p.line.name, 'precondition failed') - const trip = await client.trip(p.id, p.line.name, {when}) + const trip = await client.trip(p.tripId, p.line.name, {when}) validate(t, trip, 'trip', 'trip') t.end() diff --git a/test/vbb.js b/test/vbb.js index 9d24a48e..27e9c48f 100644 --- a/test/vbb.js +++ b/test/vbb.js @@ -151,9 +151,9 @@ test('trip details', async (t) => { }) const p = journeys[0].legs[0] - t.ok(p.id, 'precondition failed') + t.ok(p.tripId, 'precondition failed') t.ok(p.line.name, 'precondition failed') - const trip = await client.trip(p.id, p.line.name, {when}) + const trip = await client.trip(p.tripId, p.line.name, {when}) validate(t, trip, 'trip', 'trip') t.end()