diff options
| author | cedricnjanga | 2017-08-16 17:53:22 +0200 |
|---|---|---|
| committer | cedricnjanga | 2017-08-16 17:54:44 +0200 |
| commit | 8176b98b2e84ce62299f79a048156c0ec443e49e (patch) | |
| tree | 705222019978e379ca9c3f7cce8d72666b07048e /spec/javascripts | |
| parent | aea07f1fec58444bbc0b7c876d6dacddbe43bbcf (diff) | |
| download | chouette-core-8176b98b2e84ce62299f79a048156c0ec443e49e.tar.bz2 | |
Add VJ Delete company action
Diffstat (limited to 'spec/javascripts')
| -rw-r--r-- | spec/javascripts/vehicle_journeys/actions_spec.js | 13 | ||||
| -rw-r--r-- | spec/javascripts/vehicle_journeys/reducers/modal_spec.js | 9 |
2 files changed, 22 insertions, 0 deletions
diff --git a/spec/javascripts/vehicle_journeys/actions_spec.js b/spec/javascripts/vehicle_journeys/actions_spec.js index d96baf8ef..52e386deb 100644 --- a/spec/javascripts/vehicle_journeys/actions_spec.js +++ b/spec/javascripts/vehicle_journeys/actions_spec.js @@ -432,3 +432,16 @@ describe('when using select2 to pick a company', () => { expect(actions.select2Company(selectedCompany)).toEqual(expectedAction) }) }) +describe('when using select2 to unselect a company', () => { + it('should create an action to unselect a company inside modal', () => { + let selectedCompany = { + id: 1, + objectid: 2, + name: 'test', + } + const expectedAction = { + type: 'UNSELECT_CP_EDIT_MODAL' + } + expect(actions.unselect2Company()).toEqual(expectedAction) + }) +}) diff --git a/spec/javascripts/vehicle_journeys/reducers/modal_spec.js b/spec/javascripts/vehicle_journeys/reducers/modal_spec.js index c016812da..4530b5ee7 100644 --- a/spec/javascripts/vehicle_journeys/reducers/modal_spec.js +++ b/spec/javascripts/vehicle_journeys/reducers/modal_spec.js @@ -167,4 +167,13 @@ describe('modal reducer', () => { }) ).toEqual(Object.assign({}, state, {modalProps: newModalProps})) }) + + it('should handle UNSELECT_CP_EDIT_MODAL', () => { + let newModalProps = {selectedCompany : undefined} + expect( + modalReducer(state, { + type: 'UNSELECT_CP_EDIT_MODAL' + }) + ).toEqual(Object.assign({}, state, {modalProps: newModalProps})) + }) }) |
