E2E/integration validation logic: handle missing leg.alternatives[].when

This commit is contained in:
Jannis R 2020-12-07 14:34:20 +01:00 committed by Jannis Redmann
parent 17e08acfbb
commit 2d3c0d6a94

View file

@ -310,7 +310,9 @@ const createValidateJourneyLeg = (cfg) => {
a.ok(alt.direction, n + '.direction must not be empty')
}
assertValidWhen(alt.when, cfg.when, n + '.when')
if (alt.when !== null) {
assertValidWhen(alt.when, cfg.when, n + '.when')
}
if (alt.delay !== null) {
a.strictEqual(typeof alt.delay, 'number', n + '.delay must be a number')
}