diff options
Diffstat (limited to 'web/src/js/__tests__/ducks/flowsSpec.js')
-rw-r--r-- | web/src/js/__tests__/ducks/flowsSpec.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/web/src/js/__tests__/ducks/flowsSpec.js b/web/src/js/__tests__/ducks/flowsSpec.js new file mode 100644 index 00000000..2b261cb1 --- /dev/null +++ b/web/src/js/__tests__/ducks/flowsSpec.js @@ -0,0 +1,30 @@ +jest.unmock('../../ducks/flows'); + +import reduceFlows, * as flowActions from '../../ducks/flows' + + +describe('select flow', () => { + + let state = reduceFlows(undefined, {}) + for (let i of [1, 2, 3, 4]) { + state = reduceFlows(state, flowActions.addFlow({ id: i })) + } + + it('should be possible to select a single flow', () => { + expect(reduceFlows(state, flowActions.select(2))).toEqual( + { + ...state, + selected: [2], + } + ) + }) + + it('should be possible to deselect a flow', () => { + expect(reduceFlows({ ...state, selected: [1] }, flowActions.select())).toEqual( + { + ...state, + selected: [], + } + ) + }) +}) |