diff options
author | Matthew Shao <me@matshao.com> | 2017-05-21 20:59:19 +0800 |
---|---|---|
committer | Matthew Shao <me@matshao.com> | 2017-05-21 20:59:19 +0800 |
commit | 2c38fddea5eae0fe60822ee2fcf2565889f258b9 (patch) | |
tree | 80f31eea543d1814c4853b9d02da53c32288ef1e /web/src/js | |
parent | 55a58c4c6f46e7bbe78d20c31b1ede4a1357ec82 (diff) | |
download | mitmproxy-2c38fddea5eae0fe60822ee2fcf2565889f258b9.tar.gz mitmproxy-2c38fddea5eae0fe60822ee2fcf2565889f258b9.tar.bz2 mitmproxy-2c38fddea5eae0fe60822ee2fcf2565889f258b9.zip |
[web] TFlow minor improved.
Diffstat (limited to 'web/src/js')
4 files changed, 16 insertions, 14 deletions
diff --git a/web/src/js/__tests__/components/FlowTable/FlowColumnsSpec.js b/web/src/js/__tests__/components/FlowTable/FlowColumnsSpec.js index 7f30b809..1427cb1b 100644 --- a/web/src/js/__tests__/components/FlowTable/FlowColumnsSpec.js +++ b/web/src/js/__tests__/components/FlowTable/FlowColumnsSpec.js @@ -1,11 +1,11 @@ import React from 'react' import renderer from 'react-test-renderer' import * as Columns from '../../../components/FlowTable/FlowColumns' -import _tflow from '../../ducks/_tflow' +import { TFlow } from '../../ducks/tutils' describe('FlowColumns Components', () => { - let tflow = _tflow() + let tflow = TFlow() it('should render TLSColumn', () => { let tlsColumn = renderer.create(<Columns.TLSColumn flow={tflow}/>), tree = tlsColumn.toJSON() @@ -28,25 +28,25 @@ describe('FlowColumns Components', () => { tree = iconColumn.toJSON() expect(tree).toMatchSnapshot() // image - let imageFlow = _tflow() + let imageFlow = TFlow() imageFlow.response.headers = [['Content-Type', 'image/jpeg']] iconColumn = renderer.create(<Columns.IconColumn flow={imageFlow}/>) tree = iconColumn.toJSON() expect(tree).toMatchSnapshot() // javascript - let jsFlow = _tflow() + let jsFlow = TFlow() jsFlow.response.headers = [['Content-Type', 'application/x-javascript']] iconColumn = renderer.create(<Columns.IconColumn flow={jsFlow}/>) tree = iconColumn.toJSON() expect(tree).toMatchSnapshot() // css - let cssFlow = _tflow() + let cssFlow = TFlow() cssFlow.response.headers = [['Content-Type', 'text/css']] iconColumn = renderer.create(<Columns.IconColumn flow={cssFlow}/>) tree = iconColumn.toJSON() expect(tree).toMatchSnapshot() // default - let fooFlow = _tflow() + let fooFlow = TFlow() fooFlow.response.headers = [['Content-Type', 'foo']] iconColumn = renderer.create(<Columns.IconColumn flow={fooFlow}/>) tree = iconColumn.toJSON() @@ -83,7 +83,7 @@ describe('FlowColumns Components', () => { }) it('should render SizeColumn', () => { - tflow = _tflow() + tflow = TFlow() let sizeColumn = renderer.create(<Columns.SizeColumn flow={tflow}/>), tree = sizeColumn.toJSON() expect(tree).toMatchSnapshot() diff --git a/web/src/js/__tests__/components/FlowTable/__snapshots__/FlowColumnsSpec.js.snap b/web/src/js/__tests__/components/FlowTable/__snapshots__/FlowColumnsSpec.js.snap index c74f686e..9c7cec86 100644 --- a/web/src/js/__tests__/components/FlowTable/__snapshots__/FlowColumnsSpec.js.snap +++ b/web/src/js/__tests__/components/FlowTable/__snapshots__/FlowColumnsSpec.js.snap @@ -112,7 +112,7 @@ exports[`FlowColumns Components should render TimeColumn 1`] = ` <td className="col-time" > - 415322h + 415381h </td> `; diff --git a/web/src/js/__tests__/ducks/_tflow.js b/web/src/js/__tests__/ducks/_tflow.js index 8ff8c96c..f6a382bd 100644 --- a/web/src/js/__tests__/ducks/_tflow.js +++ b/web/src/js/__tests__/ducks/_tflow.js @@ -8,7 +8,7 @@ export default function(){ "alpn_proto_negotiated": "http/1.1", "cipher_name": "cipher", "clientcert": null, - "id": "75bfd3cd-a084-4d84-a063-b0804dc91342", + "id": "4a18d1a0-50a1-48dd-9aa6-d45d74282939", "sni": "address", "ssl_established": false, "timestamp_end": 3.0, @@ -18,9 +18,9 @@ export default function(){ }, "error": { "msg": "error", - "timestamp": 1495158272.596447 + "timestamp": 1495370312.4814785 }, - "id": "8035b342-c916-44f7-93fa-293b40a7d3ad", + "id": "d91165be-ca1f-4612-88a9-c0f8696f3e29", "intercepted": false, "marked": false, "modified": false, @@ -65,8 +65,8 @@ export default function(){ "is_replay": false, "reason": "OK", "status_code": 200, - "timestamp_end": 1495158272.5964308, - "timestamp_start": 1495158272.5964305 + "timestamp_end": 1495370312.4814625, + "timestamp_start": 1495370312.481462 }, "server_conn": { "address": [ @@ -74,7 +74,7 @@ export default function(){ 22 ], "alpn_proto_negotiated": null, - "id": "9a5d01d7-ede8-4409-b064-230305bfa29d", + "id": "f087e7b2-6d0a-41a8-a8f0-e1a4761395f8", "ip_address": [ "192.168.0.1", 22 diff --git a/web/src/js/__tests__/ducks/tutils.js b/web/src/js/__tests__/ducks/tutils.js index 6ae7f080..211b61e3 100644 --- a/web/src/js/__tests__/ducks/tutils.js +++ b/web/src/js/__tests__/ducks/tutils.js @@ -7,3 +7,5 @@ export function createStore(parts) { applyMiddleware(...[thunk]) ) } + +export { default as TFlow } from './_tflow' |