earlierJourneysRef -> earlierRef, laterJourneysRef -> laterRef

This commit is contained in:
Jannis R 2018-03-04 20:38:50 +01:00 committed by Jannis Redmann
parent fe7822883e
commit 88c511da27
4 changed files with 20 additions and 20 deletions

View file

@ -132,8 +132,8 @@ const createClient = (profile, request = _request) => {
const parse = profile.parseJourney(profile, d.locations, d.lines, d.remarks)
const res = d.outConL.map(parse)
if (d.outCtxScrB) res.earlierJourneysRef = d.outCtxScrB
if (d.outCtxScrF) res.laterJourneysRef = d.outCtxScrF
if (d.outCtxScrB) res.earlierRef = d.outCtxScrB
if (d.outCtxScrF) res.laterRef = d.outCtxScrF
return res
})
}

View file

@ -238,10 +238,10 @@ test('earlier/later journeys, Jungfernheide -> München Hbf', co(function* (t) {
results: 3, when
})
t.equal(typeof model.earlierJourneysRef, 'string')
t.ok(model.earlierJourneysRef)
t.equal(typeof model.laterJourneysRef, 'string')
t.ok(model.laterJourneysRef)
t.equal(typeof model.earlierRef, 'string')
t.ok(model.earlierRef)
t.equal(typeof model.laterRef, 'string')
t.ok(model.laterRef)
let earliestDep = Infinity, latestDep = -Infinity
for (let j of model) {
@ -253,7 +253,7 @@ test('earlier/later journeys, Jungfernheide -> München Hbf', co(function* (t) {
const earlier = yield client.journeys(jungfernh, münchenHbf, {
results: 3,
// todo: single journey ref?
beforeJourneys: model.earlierJourneysRef
beforeJourneys: model.earlierRef
})
for (let j of earlier) {
t.ok(new Date(j.departure) < earliestDep)
@ -262,7 +262,7 @@ test('earlier/later journeys, Jungfernheide -> München Hbf', co(function* (t) {
const later = yield client.journeys(jungfernh, münchenHbf, {
results: 3,
// todo: single journey ref?
afterJourneys: model.laterJourneysRef
afterJourneys: model.laterRef
})
for (let j of later) {
t.ok(new Date(j.departure) > latestDep)

View file

@ -279,10 +279,10 @@ test('earlier/later journeys, Salzburg Hbf -> Wien Westbahnhof', co(function* (t
results: 3, when
})
t.equal(typeof model.earlierJourneysRef, 'string')
t.ok(model.earlierJourneysRef)
t.equal(typeof model.laterJourneysRef, 'string')
t.ok(model.laterJourneysRef)
t.equal(typeof model.earlierRef, 'string')
t.ok(model.earlierRef)
t.equal(typeof model.laterRef, 'string')
t.ok(model.laterRef)
let earliestDep = Infinity, latestDep = -Infinity
for (let j of model) {
@ -294,7 +294,7 @@ test('earlier/later journeys, Salzburg Hbf -> Wien Westbahnhof', co(function* (t
const earlier = yield client.journeys(salzburgHbf, wienWestbahnhof, {
results: 3,
// todo: single journey ref?
beforeJourneys: model.earlierJourneysRef
beforeJourneys: model.earlierRef
})
for (let j of earlier) {
t.ok(new Date(j.departure) < earliestDep)
@ -303,7 +303,7 @@ test('earlier/later journeys, Salzburg Hbf -> Wien Westbahnhof', co(function* (t
const later = yield client.journeys(salzburgHbf, wienWestbahnhof, {
results: 3,
// todo: single journey ref?
afterJourneys: model.laterJourneysRef
afterJourneys: model.laterRef
})
for (let j of later) {
t.ok(new Date(j.departure) > latestDep)

View file

@ -173,10 +173,10 @@ test('earlier/later journeys', co(function* (t) {
results: 3, when
})
t.equal(typeof model.earlierJourneysRef, 'string')
t.ok(model.earlierJourneysRef)
t.equal(typeof model.laterJourneysRef, 'string')
t.ok(model.laterJourneysRef)
t.equal(typeof model.earlierRef, 'string')
t.ok(model.earlierRef)
t.equal(typeof model.laterRef, 'string')
t.ok(model.laterRef)
let earliestDep = Infinity, latestDep = -Infinity
for (let j of model) {
@ -188,7 +188,7 @@ test('earlier/later journeys', co(function* (t) {
const earlier = yield client.journeys(spichernstr, bismarckstr, {
results: 3,
// todo: single journey ref?
beforeJourneys: model.earlierJourneysRef
beforeJourneys: model.earlierRef
})
for (let j of earlier) {
t.ok(new Date(j.departure) < earliestDep)
@ -197,7 +197,7 @@ test('earlier/later journeys', co(function* (t) {
const later = yield client.journeys(spichernstr, bismarckstr, {
results: 3,
// todo: single journey ref?
afterJourneys: model.laterJourneysRef
afterJourneys: model.laterRef
})
for (let j of later) {
t.ok(new Date(j.departure) > latestDep)