aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-06-20 21:01:24 -0700
committerMaximilian Hils <git@maximilianhils.com>2016-06-20 21:01:24 -0700
commit65955ee45f4b5e66fd433924811f6753e996bea6 (patch)
treeff9324b6702d0032276d28f4f446e77ce5076216
parent37475217bf05fa44eba1551d318e6a5f6d088d7a (diff)
downloadmitmproxy-65955ee45f4b5e66fd433924811f6753e996bea6.tar.gz
mitmproxy-65955ee45f4b5e66fd433924811f6753e996bea6.tar.bz2
mitmproxy-65955ee45f4b5e66fd433924811f6753e996bea6.zip
add better description
-rw-r--r--web/src/js/__tests__/ducks/ui.js11
-rw-r--r--web/src/js/ducks/ui.js4
2 files changed, 8 insertions, 7 deletions
diff --git a/web/src/js/__tests__/ducks/ui.js b/web/src/js/__tests__/ducks/ui.js
index ee1a008d..81ae852c 100644
--- a/web/src/js/__tests__/ducks/ui.js
+++ b/web/src/js/__tests__/ducks/ui.js
@@ -1,7 +1,8 @@
jest.unmock("../../ducks/ui");
+jest.unmock("../../ducks/flows");
-import reducer, {setActiveMenu, SELECT_FLOW} from '../../ducks/ui';
-
+import reducer, {setActiveMenu} from '../../ducks/ui';
+import {SELECT_FLOW} from '../../ducks/flows';
describe("ui reducer", () => {
it("should return the initial state", () => {
@@ -10,21 +11,21 @@ describe("ui reducer", () => {
it("should return the state for view", () => {
expect(reducer(undefined, setActiveMenu('View'))).toEqual({ activeMenu: 'View'})
}),
- it("should change the state to Start", () => {
+ it("should change the state to Start when deselecting a flow and we a currently at the flow tab", () => {
expect(reducer({activeMenu: 'Flow'},
{ type: SELECT_FLOW,
currentSelection: '1',
flowId : undefined
})).toEqual({ activeMenu: 'Start'})
}),
- it("should change the state to Flow", () => {
+ it("should change the state to Flow when we selected a flow and no flow was selected before", () => {
expect(reducer({activeMenu: 'Start'},
{ type: SELECT_FLOW,
currentSelection: undefined,
flowId : '1'
})).toEqual({ activeMenu: 'Flow'})
}),
- it("should not change the state", () => {
+ it("should not change the state to Flow when OPTIONS tab is selected and we selected a flow and a flow as selected before", () => {
expect(reducer({activeMenu: 'Options'},
{ type: SELECT_FLOW,
currentSelection: '1',
diff --git a/web/src/js/ducks/ui.js b/web/src/js/ducks/ui.js
index 00468902..c17e042b 100644
--- a/web/src/js/ducks/ui.js
+++ b/web/src/js/ducks/ui.js
@@ -1,5 +1,5 @@
-export const SELECT_FLOW = "SELECT_FLOW"
-export const SET_ACTIVE_MENU = 'SET_ACTIVE_MENU'
+import {SELECT_FLOW} from "./flows"
+export const SET_ACTIVE_MENU = 'SET_ACTIVE_MENU';
const defaultState = {