diff options
author | Maximilian Hils <git@maximilianhils.com> | 2017-03-12 23:33:49 +0100 |
---|---|---|
committer | Maximilian Hils <git@maximilianhils.com> | 2017-03-12 23:33:49 +0100 |
commit | 05e11547f5875a4b5b3c109db8a1db477d1986ad (patch) | |
tree | 5c6c5acb7fedeee2e62fc5266d0d9211421fdfa5 /web/src/js/__tests__/ducks/flowViewSpec.js | |
parent | 0f4b523868856fccaf373c9108c9220a3aafb30b (diff) | |
parent | 7d5ab70ce3a6deb70aa3e30e755fdee0f3b2fdeb (diff) | |
download | mitmproxy-05e11547f5875a4b5b3c109db8a1db477d1986ad.tar.gz mitmproxy-05e11547f5875a4b5b3c109db8a1db477d1986ad.tar.bz2 mitmproxy-05e11547f5875a4b5b3c109db8a1db477d1986ad.zip |
Merge remote-tracking branch 'origin/master' into pr-2120
Conflicts:
test/mitmproxy/addons/test_replace.py
Diffstat (limited to 'web/src/js/__tests__/ducks/flowViewSpec.js')
-rw-r--r-- | web/src/js/__tests__/ducks/flowViewSpec.js | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/web/src/js/__tests__/ducks/flowViewSpec.js b/web/src/js/__tests__/ducks/flowViewSpec.js deleted file mode 100644 index d5d9a6d9..00000000 --- a/web/src/js/__tests__/ducks/flowViewSpec.js +++ /dev/null @@ -1,67 +0,0 @@ -jest.unmock('../../ducks/flows') -jest.unmock('../../ducks/flowView') -jest.unmock('../../ducks/utils/view') -jest.unmock('../../ducks/utils/list') -jest.unmock('./tutils') - -import { createStore } from './tutils' - -import flows, * as flowActions from '../../ducks/flows' -import flowView, * as flowViewActions from '../../ducks/flowView' - - -function testStore() { - let store = createStore({ - flows, - flowView - }) - for (let i of [1, 2, 3, 4]) { - store.dispatch( - flowActions.addFlow({ id: i }) - ) - } - return store -} - -describe('select relative', () => { - - function testSelect(start, relative, result) { - const store = testStore() - store.dispatch(flowActions.select(start)) - expect(store.getState().flows.selected).toEqual(start ? [start] : []) - store.dispatch(flowViewActions.selectRelative(relative)) - expect(store.getState().flows.selected).toEqual([result]) - } - - describe('previous', () => { - - it('should select the previous flow', () => { - testSelect(3, -1, 2) - }) - - it('should not changed when first flow is selected', () => { - testSelect(1, -1, 1) - }) - - it('should select first flow if no flow is selected', () => { - testSelect(undefined, -1, 1) - }) - - }) - - describe('next', () => { - - it('should select the next flow', () => { - testSelect(2, 1, 3) - }) - - it('should not changed when last flow is selected', () => { - testSelect(4, 1, 4) - }) - - it('should select last flow if no flow is selected', () => { - testSelect(undefined, 1, 4) - }) - - }) -}) |