diff --git a/docs/journeys.md b/docs/journeys.md index 81b74e24..972fe55d 100644 --- a/docs/journeys.md +++ b/docs/journeys.md @@ -179,7 +179,9 @@ The response may look like this: products: { /* … */ } }, arrival: '2017-12-17T19:09:00.000+01:00', - departure: '2017-12-17T19:09:00.000+01:00' + arrivalPlatform: '1', + departure: '2017-12-17T19:09:00.000+01:00', + departurePlatform: '1' }, /* … */ { stop: { type: 'station', @@ -189,7 +191,9 @@ The response may look like this: products: { /* … */ } }, arrival: '2017-12-17T19:17:00.000+01:00', - departure: '2017-12-17T19:17:00.000+01:00' + arrivalPlatform: '5', + departure: '2017-12-17T19:17:00.000+01:00', + departurePlatform: '5' } ] } ] }, diff --git a/test/lib/validators.js b/test/lib/validators.js index 3fd6ec6b..b3c5bd5d 100644 --- a/test/lib/validators.js +++ b/test/lib/validators.js @@ -99,7 +99,18 @@ const createValidateStopover = (cfg) => { a.strictEqual(typeof s.departureDelay, 'number', msg) } - val.station(val, s.station, name + '.station') + if (is(s.arrivalPlatform)) { + const msg = name + '.arrivalPlatform must ' + a.strictEqual(typeof s.arrivalPlatform, 'string', msg + 'be a string') + a.ok(s.arrivalPlatform, msg + 'not be empty') + } + if (is(s.departureDelay)) { + const msg = name + '.departurePlatform must ' + a.strictEqual(typeof s.departurePlatform, 'string', msg + 'be a string') + a.ok(s.departurePlatform, msg + 'not be empty') + } + + val.station(val, s.stop, name + '.stop') } return validateStopover }