diff options
author | Matthew Shao <me@matshao.com> | 2017-05-27 22:58:01 +0800 |
---|---|---|
committer | Matthew Shao <me@matshao.com> | 2017-05-27 23:12:37 +0800 |
commit | fbaa842a462bbe8360d68b24eed9e7b2d7d3c7dc (patch) | |
tree | c7377c520f6b595fd2dd4f68c001ed89030e2bdf /web/src/js | |
parent | 134331b9972e877f0c62dbbaa8ec1ee1c96d0e8c (diff) | |
download | mitmproxy-fbaa842a462bbe8360d68b24eed9e7b2d7d3c7dc.tar.gz mitmproxy-fbaa842a462bbe8360d68b24eed9e7b2d7d3c7dc.tar.bz2 mitmproxy-fbaa842a462bbe8360d68b24eed9e7b2d7d3c7dc.zip |
[web] Add tests for js/components/Header/OptionMenu.jsx
Diffstat (limited to 'web/src/js')
-rw-r--r-- | web/src/js/__tests__/components/Header/OptionMenuSpec.js | 19 | ||||
-rw-r--r-- | web/src/js/__tests__/components/Header/__snapshots__/OptionMenuSpec.js.snap | 145 |
2 files changed, 164 insertions, 0 deletions
diff --git a/web/src/js/__tests__/components/Header/OptionMenuSpec.js b/web/src/js/__tests__/components/Header/OptionMenuSpec.js new file mode 100644 index 00000000..b84fce6e --- /dev/null +++ b/web/src/js/__tests__/components/Header/OptionMenuSpec.js @@ -0,0 +1,19 @@ +import React from 'react' +import renderer from 'react-test-renderer' +import { Provider } from 'react-redux' +import OptionMenu from '../../../components/Header/OptionMenu' +import { TStore } from '../../ducks/tutils' + + +describe('OptionMenu Component', () => { + it('should render correctly', () => { + let store = TStore(), + provider = renderer.create( + <Provider store={store}> + <OptionMenu/> + </Provider> + ), + tree = provider.toJSON() + expect(tree).toMatchSnapshot() + }) +}) diff --git a/web/src/js/__tests__/components/Header/__snapshots__/OptionMenuSpec.js.snap b/web/src/js/__tests__/components/Header/__snapshots__/OptionMenuSpec.js.snap new file mode 100644 index 00000000..9299e69f --- /dev/null +++ b/web/src/js/__tests__/components/Header/__snapshots__/OptionMenuSpec.js.snap @@ -0,0 +1,145 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`OptionMenu Component should render correctly 1`] = ` +<div> + <div + className="menu-group" + > + <div + className="menu-content" + > + <div + className="menu-entry" + > + <label> + <input + checked={false} + onChange={[Function]} + type="checkbox" + /> + HTTP/2.0 + </label> + </div> + <div + className="menu-entry" + > + <label> + <input + checked={false} + onChange={[Function]} + type="checkbox" + /> + WebSockets + </label> + </div> + <div + className="menu-entry" + > + <label> + <input + checked={false} + onChange={[Function]} + type="checkbox" + /> + Raw TCP + </label> + </div> + </div> + <div + className="menu-legend" + > + Protocol Support + </div> + </div> + <div + className="menu-group" + > + <div + className="menu-content" + > + <div + className="menu-entry" + > + <label> + <input + checked={true} + onChange={[Function]} + type="checkbox" + /> + Disable Caching + <a + href="http://docs.mitmproxy.org/en/stable/features/anticache.html" + target="_blank" + > + <i + className="fa fa-question-circle" + /> + </a> + </label> + </div> + <div + className="menu-entry" + > + <label> + <input + checked={false} + onChange={[Function]} + type="checkbox" + /> + Disable Compression + <i + className="fa fa-question-circle" + title="Do not forward Accept-Encoding headers to the server to force an uncompressed response." + /> + </label> + </div> + </div> + <div + className="menu-legend" + > + HTTP Options + </div> + </div> + <div + className="menu-group" + > + <div + className="menu-content" + > + <div + className="menu-entry" + > + <label> + <input + checked={false} + onChange={[Function]} + type="checkbox" + /> + Use Host Header + <i + className="fa fa-question-circle" + title="Use the Host header to construct URLs for display." + /> + </label> + </div> + <div + className="menu-entry" + > + <label> + <input + checked={true} + onChange={[Function]} + type="checkbox" + /> + Display Event Log + </label> + </div> + </div> + <div + className="menu-legend" + > + View Options + </div> + </div> +</div> +`; |