mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 15:19:35 +02:00
CFL tests: ignore missing direction
This commit is contained in:
parent
75432fcf4c
commit
d5f9675c2a
1 changed files with 17 additions and 1 deletions
18
test/cfl.js
18
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()
|
||||
})
|
||||
|
|
Loading…
Add table
Reference in a new issue