From 22a1709c8b174c0715ebfd92ab8e710947284008 Mon Sep 17 00:00:00 2001 From: Matthew Shao Date: Wed, 17 May 2017 22:27:20 +0800 Subject: [web] Add a TFlow class to js/ducks/tutils.js Many Components requires a flow object when being rendered, so we put a TFlow class here, currently has the minimize structure, only contains the attributes we needed in the components to be tested. --- web/src/js/__tests__/ducks/tutils.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'web/src/js/__tests__/ducks/tutils.js') diff --git a/web/src/js/__tests__/ducks/tutils.js b/web/src/js/__tests__/ducks/tutils.js index 6ae7f080..70992bcb 100644 --- a/web/src/js/__tests__/ducks/tutils.js +++ b/web/src/js/__tests__/ducks/tutils.js @@ -7,3 +7,30 @@ export function createStore(parts) { applyMiddleware(...[thunk]) ) } + +export function TFlow(intercepted=false, marked=false, modified=false) { + return { + intercepted : intercepted, + marked : marked, + modified: modified, + id: "foo", + request: { + scheme: 'http', + is_replay: true, + method: 'GET', + contentLength: 100 + }, + response: { + status_code: 200, + headers: [["Content-Type", 'text/html']], + timestamp_end: 200 + }, + error: { + msg: '' + }, + server_conn: { + timestamp_start: 100 + }, + type: 'http' + } +} -- cgit v1.2.3 From d902b851c8ba9a9de1e8486cc9348d69a7e0dd08 Mon Sep 17 00:00:00 2001 From: Matthew Shao Date: Thu, 18 May 2017 10:42:06 +0800 Subject: [web] Minor fixes for component tests. --- web/src/js/__tests__/ducks/tutils.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'web/src/js/__tests__/ducks/tutils.js') diff --git a/web/src/js/__tests__/ducks/tutils.js b/web/src/js/__tests__/ducks/tutils.js index 70992bcb..f140222d 100644 --- a/web/src/js/__tests__/ducks/tutils.js +++ b/web/src/js/__tests__/ducks/tutils.js @@ -10,9 +10,9 @@ export function createStore(parts) { export function TFlow(intercepted=false, marked=false, modified=false) { return { - intercepted : intercepted, - marked : marked, - modified: modified, + intercepted , + marked, + modified, id: "foo", request: { scheme: 'http', -- cgit v1.2.3