diff options
Diffstat (limited to 'spec/javascripts')
| -rw-r--r-- | spec/javascripts/journey_patterns/actions_spec.js | 6 | ||||
| -rw-r--r-- | spec/javascripts/journey_patterns/reducers/pagination_spec.js | 9 |
2 files changed, 13 insertions, 2 deletions
diff --git a/spec/javascripts/journey_patterns/actions_spec.js b/spec/javascripts/journey_patterns/actions_spec.js index 03198c2c4..736a4326a 100644 --- a/spec/javascripts/journey_patterns/actions_spec.js +++ b/spec/javascripts/journey_patterns/actions_spec.js @@ -26,13 +26,17 @@ describe('when landing on page', () => { describe('when next navigation button is clicked', () => { it('should create an action to go to next page', () => { const nextPage = true + const totalCount = 25 + const perPage = 12 const expectedAction = { type: 'GO_TO_NEXT_PAGE', dispatch, currentPage, + totalCount, + perPage, nextPage } - expect(actions.goToNextPage(dispatch, currentPage)).toEqual(expectedAction) + expect(actions.goToNextPage(dispatch, currentPage, totalCount, perPage)).toEqual(expectedAction) }) }) describe('when clicking on a journey pattern checkbox', () => { diff --git a/spec/javascripts/journey_patterns/reducers/pagination_spec.js b/spec/javascripts/journey_patterns/reducers/pagination_spec.js index 1c8011fca..430db4b64 100644 --- a/spec/javascripts/journey_patterns/reducers/pagination_spec.js +++ b/spec/javascripts/journey_patterns/reducers/pagination_spec.js @@ -1,7 +1,11 @@ var reducer = require('es6_browserified/journey_patterns/reducers/pagination') + +const totalCount = 25 +const perPage = 12 let state = { page : 2, - totalCount : 25 + totalCount : totalCount, + stateChanged: false } let currentPage = 2 const dispatch = function(){} @@ -20,6 +24,8 @@ describe('pagination reducer, given parameters allowing page change', () => { type: 'GO_TO_NEXT_PAGE', dispatch, currentPage, + totalCount, + perPage, nextPage : true }) ).toEqual(Object.assign({}, state, {page : state.page + 1, stateChanged: false})) @@ -70,6 +76,7 @@ describe('pagination reducer, given parameters not allowing to go to next page', type: 'GO_TO_NEXT_PAGE', dispatch, currentPage, + totalCount, nextPage : false }) ).toEqual(state) |
