diff options
Diffstat (limited to 'web/src/js/__tests__/ducks/optionsSpec.js')
-rw-r--r-- | web/src/js/__tests__/ducks/optionsSpec.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/web/src/js/__tests__/ducks/optionsSpec.js b/web/src/js/__tests__/ducks/optionsSpec.js new file mode 100644 index 00000000..62019715 --- /dev/null +++ b/web/src/js/__tests__/ducks/optionsSpec.js @@ -0,0 +1,25 @@ +jest.mock('../../utils') + +import reduceOptions, * as OptionsActions from '../../ducks/options' + +describe('option reducer', () => { + it('should return initial state', () => { + expect(reduceOptions(undefined, {})).toEqual({}) + }) + + it('should handle receive action', () => { + let action = { type: OptionsActions.RECEIVE, data: 'foo' } + expect(reduceOptions(undefined, action)).toEqual('foo') + }) + + it('should handle update action', () => { + let action = {type: OptionsActions.UPDATE, data: {id: 1} } + expect(reduceOptions(undefined, action)).toEqual({id: 1}) + }) +}) + +describe('option actions', () => { + it('should be possible to update option', () => { + expect(reduceOptions(undefined, OptionsActions.update())).toEqual({}) + }) +}) |