aboutsummaryrefslogtreecommitdiffstats
path: root/spec/javascripts
diff options
context:
space:
mode:
authorThomas Haddad2017-02-22 12:29:10 +0100
committerThomas Haddad2017-02-22 12:29:10 +0100
commit530109322e61cbc7c0127a243ab467d468c50ebe (patch)
tree53fc4247503ecaa41c5173ee86976a8ae91ad121 /spec/javascripts
parentcd8ea5648980d899206197da79cae226de5df378 (diff)
downloadchouette-core-530109322e61cbc7c0127a243ab467d468c50ebe.tar.bz2
Fix Shift feature with preselected vehicle journey
Signed-off-by: Thomas Shawarma Haddad <thomas.haddad@af83.com>
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/vehicle_journeys/reducers/vehicle_journeys_spec.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/spec/javascripts/vehicle_journeys/reducers/vehicle_journeys_spec.js b/spec/javascripts/vehicle_journeys/reducers/vehicle_journeys_spec.js
index 1e1c16796..93f557e03 100644
--- a/spec/javascripts/vehicle_journeys/reducers/vehicle_journeys_spec.js
+++ b/spec/javascripts/vehicle_journeys/reducers/vehicle_journeys_spec.js
@@ -33,7 +33,7 @@ describe('vehicleJourneys reducer', () => {
published_journey_name: "vj1",
objectid: '11',
deletable: false,
- selected: false,
+ selected: true,
footnotes: fakeFootnotes,
time_tables: fakeTimeTables,
vehicle_journey_at_stops: fakeVJAS
@@ -42,7 +42,7 @@ describe('vehicleJourneys reducer', () => {
journey_pattern_id: 2,
published_journey_name: "vj2",
objectid: '22',
- selected: true,
+ selected: false,
deletable: false,
footnotes: fakeFootnotes,
time_tables: fakeTimeTables,
@@ -117,23 +117,23 @@ describe('vehicleJourneys reducer', () => {
})
it('should handle SELECT_VEHICLEJOURNEY', () => {
- const index = 0
- const newVJ = Object.assign({}, state[0], {selected: true})
+ const index = 1
+ const newVJ = Object.assign({}, state[1], {selected: true})
expect(
vjReducer(state, {
type: 'SELECT_VEHICLEJOURNEY',
index
})
- ).toEqual([newVJ, state[1]])
+ ).toEqual([state[0], newVJ])
})
it('should handle DELETE_VEHICLEJOURNEYS', () => {
- const newVJ = Object.assign({}, state[1], {deletable: true})
+ const newVJ = Object.assign({}, state[0], {deletable: true})
expect(
vjReducer(state, {
type: 'DELETE_VEHICLEJOURNEYS'
})
- ).toEqual([state[0], newVJ])
+ ).toEqual([newVJ, state[1]])
})
it('should handle SHIFT_VEHICLEJOURNEY', () => {