aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/__tests__
diff options
context:
space:
mode:
authorMatthew Shao <me@matshao.com>2017-07-05 18:55:56 +0800
committerMatthew Shao <me@matshao.com>2017-07-05 18:55:56 +0800
commit7516f706b41de0c10c2bf9b88278afb6e3edcd4a (patch)
treecf75e203be428adac4f7c2e3b64aa278170fdf3f /web/src/js/__tests__
parente8f3b740c944401a01d3c57e8d1c6051e92b8236 (diff)
downloadmitmproxy-7516f706b41de0c10c2bf9b88278afb6e3edcd4a.tar.gz
mitmproxy-7516f706b41de0c10c2bf9b88278afb6e3edcd4a.tar.bz2
mitmproxy-7516f706b41de0c10c2bf9b88278afb6e3edcd4a.zip
[web] Update Option Modal UI and its tests.
Diffstat (limited to 'web/src/js/__tests__')
-rw-r--r--web/src/js/__tests__/components/Modal/__snapshots__/ModalSpec.js.snap79
-rw-r--r--web/src/js/__tests__/ducks/tutils.js30
2 files changed, 108 insertions, 1 deletions
diff --git a/web/src/js/__tests__/components/Modal/__snapshots__/ModalSpec.js.snap b/web/src/js/__tests__/components/Modal/__snapshots__/ModalSpec.js.snap
index 4fe163d1..af587ae4 100644
--- a/web/src/js/__tests__/components/Modal/__snapshots__/ModalSpec.js.snap
+++ b/web/src/js/__tests__/components/Modal/__snapshots__/ModalSpec.js.snap
@@ -46,7 +46,84 @@ exports[`Modal Component should render correctly 2`] = `
<div
className="modal-body"
>
- ...
+ <div
+ className="menu-entry"
+ >
+ <label>
+ booleanOption
+ <input
+ checked={false}
+ onChange={[Function]}
+ title="foo"
+ type="checkbox"
+ />
+ </label>
+ </div>
+ <div
+ className="menu-entry"
+ >
+ <label
+ htmlFor=""
+ >
+ choiceOption
+ <select
+ name="choiceOption"
+ onChange={[Function]}
+ selected="b"
+ title="foo"
+ >
+ <option
+ value="a"
+ >
+
+ a
+
+ </option>
+ <option
+ value="b"
+ >
+
+ b
+
+ </option>
+ <option
+ value="c"
+ >
+
+ c
+
+ </option>
+ </select>
+ </label>
+ </div>
+ <div
+ className="menu-entry"
+ >
+ <label>
+ intOption
+ <input
+ onChange={[Function]}
+ onKeyDown={[Function]}
+ title="foo"
+ type="number"
+ value={1}
+ />
+ </label>
+ </div>
+ <div
+ className="menu-entry"
+ >
+ <label>
+ strOption
+ <input
+ onChange={[Function]}
+ onKeyDown={[Function]}
+ title="foo"
+ type="text"
+ value="str content"
+ />
+ </label>
+ </div>
</div>
<div
className="modal-footer"
diff --git a/web/src/js/__tests__/ducks/tutils.js b/web/src/js/__tests__/ducks/tutils.js
index 9b92e676..a3e9c168 100644
--- a/web/src/js/__tests__/ducks/tutils.js
+++ b/web/src/js/__tests__/ducks/tutils.js
@@ -42,6 +42,36 @@ export function TStore(){
anticache: true,
anticomp: false
},
+ options: {
+ booleanOption: {
+ choices: null,
+ default: false,
+ help: "foo",
+ type: "bool",
+ value: false
+ },
+ strOption: {
+ choices: null,
+ default: null,
+ help: "foo",
+ type: "str",
+ value: "str content"
+ },
+ intOption: {
+ choices: null,
+ default: 0,
+ help: "foo",
+ type: "int",
+ value: 1
+ },
+ choiceOption: {
+ choices: ['a', 'b', 'c'],
+ default: 'a',
+ help: "foo",
+ type: "str",
+ value: "b"
+ },
+ },
flows: {
selected: ["d91165be-ca1f-4612-88a9-c0f8696f3e29"],
byId: {"d91165be-ca1f-4612-88a9-c0f8696f3e29": tflow},