diff --git a/test/cfl.js b/test/cfl.js index 0b3e1c79..839bd158 100644 --- a/test/cfl.js +++ b/test/cfl.js @@ -10,6 +10,8 @@ const createClient = require('..') const cflProfile = require('../p/cfl') const products = require('../p/cfl/products') const { + line: createValidateLine, + journeyLeg: createValidateJourneyLeg, movement: _validateMovement } = require('./lib/validators') const createValidate = require('./lib/validate-fptf-with') @@ -32,6 +34,18 @@ const cfg = { maxLongitude: 14.07 } +const _validateLine = createValidateLine(cfg) +const validateLine = (validate, l, name) => { + if (!l.direction) l = Object.assign({}, l, {direction: 'foo'}) + _validateLine(validate, l, name) +} + +const _validateJourneyLeg = createValidateJourneyLeg(cfg) +const validateJourneyLeg = (validate, l, name) => { + if (!l.direction) l = Object.assign({}, l, {direction: 'foo'}) + _validateJourneyLeg(validate, l, name) +} + const validateMovement = (val, m, name = 'movement') => { // todo: fix this upstream const withFakeLocation = Object.assign({}, m) @@ -48,6 +62,8 @@ const validateMovement = (val, m, name = 'movement') => { } const validate = createValidate(cfg, { + line: validateLine, + journeyLeg: validateJourneyLeg, movement: validateMovement }) @@ -130,7 +146,7 @@ test('Luxembourg to Centre Hospitalier du Nord', async (t) => { res, validate, fromId: luxembourg, - to: kloster + to: centreHospitalier }) t.end() })