aboutsummaryrefslogtreecommitdiffstats
path: root/spec/javascripts
diff options
context:
space:
mode:
authorThomas Haddad2017-02-28 15:36:13 +0100
committerThomas Haddad2017-02-28 15:36:13 +0100
commit496cb95c40d2108a89ec6c3aef534ab496066861 (patch)
treea9f708bcd72a3664e614cf47aa92f61e1afd0fc9 /spec/javascripts
parent3377eea59a660f0817c29a6ed7fa9a466c66a070 (diff)
downloadchouette-core-496cb95c40d2108a89ec6c3aef534ab496066861.tar.bz2
Refs #2521: Add Tools Wrapper and CANCEL_SELECTION action
Signed-off-by: Thomas Shawarma Haddad <thomas.haddad@af83.com>
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/vehicle_journeys/actions_spec.js9
-rw-r--r--spec/javascripts/vehicle_journeys/reducers/vehicle_journeys_spec.js11
2 files changed, 20 insertions, 0 deletions
diff --git a/spec/javascripts/vehicle_journeys/actions_spec.js b/spec/javascripts/vehicle_journeys/actions_spec.js
index f602a8c89..593e1b092 100644
--- a/spec/javascripts/vehicle_journeys/actions_spec.js
+++ b/spec/javascripts/vehicle_journeys/actions_spec.js
@@ -91,6 +91,15 @@ describe('when checking a vehicleJourney', () => {
expect(actions.selectVehicleJourney(index)).toEqual(expectedAction)
})
})
+describe('when clicking on cancel selection button', () => {
+ it('should create an action to cancel whole selection', () => {
+ const index = 1
+ const expectedAction = {
+ type: 'CANCEL_SELECTION'
+ }
+ expect(actions.cancelSelection()).toEqual(expectedAction)
+ })
+})
describe('when clicking on delete button', () => {
it('should create an action to delete vj', () => {
const expectedAction = {
diff --git a/spec/javascripts/vehicle_journeys/reducers/vehicle_journeys_spec.js b/spec/javascripts/vehicle_journeys/reducers/vehicle_journeys_spec.js
index ac4c299c9..422cd1461 100644
--- a/spec/javascripts/vehicle_journeys/reducers/vehicle_journeys_spec.js
+++ b/spec/javascripts/vehicle_journeys/reducers/vehicle_journeys_spec.js
@@ -153,6 +153,17 @@ describe('vehicleJourneys reducer', () => {
).toEqual([state[0], newVJ])
})
+ it('should handle CANCEL_SELECTION', () => {
+ const index = 1
+ const newVJ = Object.assign({}, state[0], {selected: false})
+ expect(
+ vjReducer(state, {
+ type: 'CANCEL_SELECTION',
+ index
+ })
+ ).toEqual([newVJ, state[1]])
+ })
+
it('should handle DELETE_VEHICLEJOURNEYS', () => {
const newVJ = Object.assign({}, state[0], {deletable: true})
expect(