aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorZog2017-12-22 13:56:48 +0100
committerZog2017-12-22 13:56:48 +0100
commitf9978a2cde70f378ec1d8afa34f086ad78a0e1be (patch)
treea6166e0b28f2a3cee219a56214572590c3f28a21 /spec
parentb1068fb08a20a0502ba3654d38207a99e5c756d9 (diff)
downloadchouette-core-f9978a2cde70f378ec1d8afa34f086ad78a0e1be.tar.bz2
Update Specs to what should be the correct behaviour
Diffstat (limited to 'spec')
-rw-r--r--spec/javascript/routes/reducers/stop_points_spec.js18
1 files changed, 16 insertions, 2 deletions
diff --git a/spec/javascript/routes/reducers/stop_points_spec.js b/spec/javascript/routes/reducers/stop_points_spec.js
index b812fbb71..124618f9d 100644
--- a/spec/javascript/routes/reducers/stop_points_spec.js
+++ b/spec/javascript/routes/reducers/stop_points_spec.js
@@ -2,6 +2,12 @@ import stopPointsReducer from '../../../../app/javascript/routes/reducers/stopPo
import formHelper from '../../../../app/javascript/routes/form_helper'
import _ from 'lodash'
+ // _ _ ___ _ ___ ___ ___ ___
+ // | || | __| | | _ \ __| _ \/ __|
+ // | __ | _|| |__| _/ _|| /\__ \
+ // |_||_|___|____|_| |___|_|_\|___/
+ //
+
let state = []
formHelper.addInput = (...args)=>{}
@@ -44,6 +50,14 @@ let it_should_handle = (action, final_state, custom_state=null) => {
})
}
+
+ // ___ ___ ___ ___ ___
+ // / __| _ \ __/ __/ __|
+ // \__ \ _/ _| (__\__ \
+ // |___/_| |___\___|___/
+ //
+
+
describe('stops reducer', () => {
beforeEach(()=>{
state = [ stop_point_1, stop_point_2, stop_point_3 ]
@@ -62,12 +76,12 @@ describe('stops reducer', () => {
it_should_handle(
{type: 'MOVE_STOP_UP', index: 1},
- [ update_stop_point(stop_point_2, {stoppoint_id: 72}), update_stop_point(stop_point_1, {stoppoint_id: 73}), stop_point_3 ]
+ [ update_stop_point(stop_point_2, {index: 0}), update_stop_point(stop_point_1, {index: 1}), stop_point_3 ]
)
it_should_handle(
{type: 'MOVE_STOP_DOWN', index: 0},
- [ update_stop_point(stop_point_2, {stoppoint_id: 72}), update_stop_point(stop_point_1, {stoppoint_id: 73}), stop_point_3 ]
+ [ update_stop_point(stop_point_2, {index: 0}), update_stop_point(stop_point_1, {index: 1}), stop_point_3 ]
)
it_should_handle(