aboutsummaryrefslogtreecommitdiffstats
path: root/spec/javascripts
diff options
context:
space:
mode:
Diffstat (limited to 'spec/javascripts')
-rw-r--r--spec/javascripts/vehicle_journeys/actions_spec.js10
-rw-r--r--spec/javascripts/vehicle_journeys/reducers/pagination_spec.js9
2 files changed, 19 insertions, 0 deletions
diff --git a/spec/javascripts/vehicle_journeys/actions_spec.js b/spec/javascripts/vehicle_journeys/actions_spec.js
index 6916f463f..b9876b331 100644
--- a/spec/javascripts/vehicle_journeys/actions_spec.js
+++ b/spec/javascripts/vehicle_journeys/actions_spec.js
@@ -396,3 +396,13 @@ describe('when submitting new vj', () => {
expect(actions.updateTotalCount(diff)).toEqual(expectedAction)
})
})
+describe('when receiving vj', () => {
+ it('should create an action to show pagination totalCount', () => {
+ const total = 1
+ const expectedAction = {
+ type: 'RECEIVE_TOTAL_COUNT',
+ total
+ }
+ expect(actions.receiveTotalCount(total)).toEqual(expectedAction)
+ })
+})
diff --git a/spec/javascripts/vehicle_journeys/reducers/pagination_spec.js b/spec/javascripts/vehicle_journeys/reducers/pagination_spec.js
index ff74e1a0d..57417a3b9 100644
--- a/spec/javascripts/vehicle_journeys/reducers/pagination_spec.js
+++ b/spec/javascripts/vehicle_journeys/reducers/pagination_spec.js
@@ -18,6 +18,15 @@ describe('pagination reducer, given parameters allowing page change', () => {
).toEqual({})
})
+ it('should handle RECEIVE_TOTAL_COUNT', () => {
+ expect(
+ reducer(state, {
+ type: 'RECEIVE_TOTAL_COUNT',
+ total: 1
+ })
+ ).toEqual(Object.assign({}, state, {totalCount: 1}))
+ })
+
it('should handle RESET_PAGINATION', () => {
expect(
reducer(state, {