aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/__tests__/ducks/tutils.js
blob: f140222d7d5525e587b2c7771142dfed3e5d193d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { combineReducers, applyMiddleware, createStore as createReduxStore } from 'redux'
import thunk from 'redux-thunk'

export function createStore(parts) {
    return createReduxStore(
        combineReducers(parts),
        applyMiddleware(...[thunk])
    )
}

export function TFlow(intercepted=false, marked=false, modified=false) {
    return {
        intercepted ,
        marked,
        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'
    }
}