mirror of
https://github.com/public-transport/db-vendo-client.git
synced 2025-02-23 07:09:35 +02:00
test earlier/later journeys test 💚
This commit is contained in:
parent
ef40e827ae
commit
0ce28fc783
1 changed files with 6 additions and 2 deletions
|
@ -66,7 +66,9 @@ const testEarlierLaterJourneys = co(function* (cfg) {
|
|||
earlierThan: model.earlierRef
|
||||
})
|
||||
for (let j of earlier) {
|
||||
t.ok(new Date(j.legs[0].departure) < earliestDep)
|
||||
const firstLeg = j.legs[0]
|
||||
const dep = new Date(firstLeg.departure || firstLeg.formerScheduledDeparture)
|
||||
t.ok(dep < earliestDep)
|
||||
}
|
||||
|
||||
const later = yield fetchJourneys(fromId, toId, {
|
||||
|
@ -75,7 +77,9 @@ const testEarlierLaterJourneys = co(function* (cfg) {
|
|||
laterThan: model.laterRef
|
||||
})
|
||||
for (let j of later) {
|
||||
t.ok(new Date(j.legs[0].departure) > latestDep)
|
||||
const firstLeg = j.legs[0]
|
||||
const dep = new Date(firstLeg.departure || firstLeg.formerScheduledDeparture)
|
||||
t.ok(dep > latestDep)
|
||||
}
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue