Skip to content

Commit 4cf9c0e

Browse files
authored
Merge pull request #420 from opentripplanner/dev
Patch release July 22 2021
2 parents 3f5a2a5 + 518def8 commit 4cf9c0e

File tree

109 files changed

+1810
-1067
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

109 files changed

+1810
-1067
lines changed

Diff for: __tests__/actions/__snapshots__/api.js.snap

+61-1
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,37 @@ Array [
1212
"pending": 1,
1313
"routingType": "ITINERARY",
1414
"searchId": "abcd1234",
15+
"updateSearchInReducer": false,
1516
},
1617
"type": "ROUTING_REQUEST",
1718
},
1819
],
1920
Array [
2021
[Function],
2122
],
23+
Array [
24+
Object {
25+
"payload": Object {
26+
"requestId": "abcd1238",
27+
"response": Object {
28+
"fake": "response",
29+
},
30+
"searchId": "abcd1234",
31+
},
32+
"type": "ROUTING_RESPONSE",
33+
},
34+
],
35+
Array [
36+
Object {
37+
"payload": Object {
38+
"error": [TypeError: Cannot read property 'trackRecent' of undefined],
39+
"requestId": "abcd1239",
40+
"searchId": "abcd1234",
41+
"url": "http://mock-host.com:80/api/plan?fromPlace=Origin%20%2812%2C34%29%3A%3A12%2C34&toPlace=Destination%20%2834%2C12%29%3A%3A34%2C12&mode=WALK%2CTRANSIT&ignoreRealtimeUpdates=false",
42+
},
43+
"type": "ROUTING_ERROR",
44+
},
45+
],
2246
Array [
2347
[Function],
2448
],
@@ -28,14 +52,26 @@ Array [
2852
"activeItinerary": 0,
2953
"pending": 1,
3054
"routingType": "ITINERARY",
31-
"searchId": "abcd1235",
55+
"searchId": "abcd1237",
56+
"updateSearchInReducer": false,
3257
},
3358
"type": "ROUTING_REQUEST",
3459
},
3560
],
3661
Array [
3762
[Function],
3863
],
64+
Array [
65+
Object {
66+
"payload": Object {
67+
"error": [Error: Received error from server],
68+
"requestId": "abcd1240",
69+
"searchId": "abcd1237",
70+
"url": "http://mock-host.com:80/api/plan?fromPlace=Origin%20%2812%2C34%29%3A%3A12%2C34&toPlace=Destination%20%2834%2C12%29%3A%3A34%2C12&mode=WALK%2CTRANSIT&ignoreRealtimeUpdates=false",
71+
},
72+
"type": "ROUTING_ERROR",
73+
},
74+
],
3975
]
4076
`;
4177

@@ -51,13 +87,37 @@ Array [
5187
"pending": 1,
5288
"routingType": "ITINERARY",
5389
"searchId": "abcd1234",
90+
"updateSearchInReducer": false,
5491
},
5592
"type": "ROUTING_REQUEST",
5693
},
5794
],
5895
Array [
5996
[Function],
6097
],
98+
Array [
99+
Object {
100+
"payload": Object {
101+
"requestId": "abcd1235",
102+
"response": Object {
103+
"fake": "response",
104+
},
105+
"searchId": "abcd1234",
106+
},
107+
"type": "ROUTING_RESPONSE",
108+
},
109+
],
110+
Array [
111+
Object {
112+
"payload": Object {
113+
"error": [TypeError: Cannot read property 'trackRecent' of undefined],
114+
"requestId": "abcd1236",
115+
"searchId": "abcd1234",
116+
"url": "http://mock-host.com:80/api/plan?fromPlace=Origin%20%2812%2C34%29%3A%3A12%2C34&toPlace=Destination%20%2834%2C12%29%3A%3A34%2C12&mode=WALK%2CTRANSIT&ignoreRealtimeUpdates=false",
117+
},
118+
"type": "ROUTING_ERROR",
119+
},
120+
],
61121
]
62122
`;
63123

Diff for: __tests__/actions/api.js

+16
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ describe('actions > api', () => {
4444
})
4545

4646
await routingQueryAction(mockDispatch, mockGetState)
47+
48+
setMockRequestIds(mockDispatch.mock.calls)
4749
expect(mockDispatch.mock.calls).toMatchSnapshot()
4850
})
4951

@@ -57,7 +59,21 @@ describe('actions > api', () => {
5759
})
5860
await routingQueryAction(mockDispatch, mockGetState)
5961

62+
setMockRequestIds(mockDispatch.mock.calls)
6063
expect(mockDispatch.mock.calls).toMatchSnapshot()
6164
})
6265
})
6366
})
67+
68+
/**
69+
* Sets the requestId values as needed to deterministic IDs.
70+
*/
71+
function setMockRequestIds (calls) {
72+
calls.forEach(call => {
73+
call.forEach(action => {
74+
if (action.payload && action.payload.requestId) {
75+
action.payload.requestId = randId()
76+
}
77+
})
78+
})
79+
}

Diff for: __tests__/util/itinerary.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ describe('util > itinerary', () => {
2929
rentedVehicle: true
3030
}
3131
const rideHailLeg = {
32-
mode: 'CAR_HAIL',
33-
hailedCar: true
32+
hailedCar: true,
33+
mode: 'CAR_HAIL'
3434
}
3535

3636
const testCases = [{

Diff for: example-config.yml

+18
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,24 @@ modes:
170170
# - id: call
171171
# # Provides UI elements for planning field trips on transit vehicles.
172172
# - id: ft
173+
# # An optional maximum number of requests to make to OTP when trying to
174+
# # find itineraries. Defaults to 10 if not provided.
175+
# maxRequests: 10
176+
# # An optional minimum remaining capacity that a tripId must retain in the
177+
# # event that multiple field trips use the same trip. Defaults to 10 if not
178+
# # provided.
179+
# minimumAllowableRemainingCapacity: 10
180+
# # An optional lookup of the field trip capacity for each mode. Defaults
181+
# # are shown below if any one of these are not provided.
182+
# modeCapacities:
183+
# TRAM: 80
184+
# SUBWAY: 120
185+
# RAIL: 80
186+
# BUS: 40
187+
# FERRY: 100
188+
# CABLE_CAR: 20
189+
# GONDOLA: 15
190+
# FUNICULAR: 20
173191
# # Provides a form for constructing PDF documents for mailing to customers.
174192
# - id: mailables
175193
# items:

0 commit comments

Comments
 (0)