diff options
author | Matthew Shao <me@matshao.com> | 2017-06-05 10:17:24 +0800 |
---|---|---|
committer | Matthew Shao <me@matshao.com> | 2017-06-05 10:17:24 +0800 |
commit | 46eae0a0b65e4064cd06658baf69957d37b503fe (patch) | |
tree | a9af2cda45f7b8747cba3419a9ec98b6deb0ea9e /web/src/js/__tests__ | |
parent | f3c2123bc7c43d1f923f847e62ecdf749c7960c3 (diff) | |
download | mitmproxy-46eae0a0b65e4064cd06658baf69957d37b503fe.tar.gz mitmproxy-46eae0a0b65e4064cd06658baf69957d37b503fe.tar.bz2 mitmproxy-46eae0a0b65e4064cd06658baf69957d37b503fe.zip |
[web] Add tests for js/components/ContentView/DownloadContentButton.jsx
Diffstat (limited to 'web/src/js/__tests__')
-rw-r--r-- | web/src/js/__tests__/components/ContentView/DownloadContentButtonSpec.js | 15 | ||||
-rw-r--r-- | web/src/js/__tests__/components/ContentView/__snapshots__/DownloadContentButtonSpec.js.snap | 13 |
2 files changed, 28 insertions, 0 deletions
diff --git a/web/src/js/__tests__/components/ContentView/DownloadContentButtonSpec.js b/web/src/js/__tests__/components/ContentView/DownloadContentButtonSpec.js new file mode 100644 index 00000000..fd00627d --- /dev/null +++ b/web/src/js/__tests__/components/ContentView/DownloadContentButtonSpec.js @@ -0,0 +1,15 @@ +import React from 'react' +import renderer from 'react-test-renderer' +import DownloadContentButton from '../../../components/ContentView/DownloadContentButton' +import { TFlow } from '../../ducks/tutils' + +let tflow = new TFlow() +describe('DownloadContentButton Component', () => { + it('should render correctly', () => { + let downloadContentButton = renderer.create( + <DownloadContentButton flow={tflow} message={tflow.response}/> + ), + tree = downloadContentButton.toJSON() + expect(tree).toMatchSnapshot() + }) +}) diff --git a/web/src/js/__tests__/components/ContentView/__snapshots__/DownloadContentButtonSpec.js.snap b/web/src/js/__tests__/components/ContentView/__snapshots__/DownloadContentButtonSpec.js.snap new file mode 100644 index 00000000..66900ca4 --- /dev/null +++ b/web/src/js/__tests__/components/ContentView/__snapshots__/DownloadContentButtonSpec.js.snap @@ -0,0 +1,13 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`DownloadContentButton Component should render correctly 1`] = ` +<a + className="btn btn-default btn-xs" + href="/flows/d91165be-ca1f-4612-88a9-c0f8696f3e29/response/content" + title="Download the content of the flow." +> + <i + className="fa fa-download" + /> +</a> +`; |