aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/__tests__/components/FlowView/DetailsSpec.js
blob: 1b0192cffefef19c76d87f7975c600064b1578ba (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import React from 'react'
import renderer from 'react-test-renderer'
import Details, { TimeStamp, ConnectionInfo, CertificateInfo, Timing } from '../../../components/FlowView/Details'
import { TFlow } from '../../ducks/tutils'

let tflow = TFlow()

describe('TimeStamp Component', () => {
    it('should render correctly', () => {
        let timestamp = renderer.create(<TimeStamp t={1483228800} deltaTo={1483228700} title="foo"/>),
            tree = timestamp.toJSON()
        expect(tree).toMatchSnapshot()
        // without timestamp
        timestamp = renderer.create(<TimeStamp/>)
        tree = timestamp.toJSON()
        expect(tree).toMatchSnapshot()
    })
})

describe('ConnectionInfo Component', () => {
    it('should render correctly', () => {
        let connectionInfo = renderer.create(<ConnectionInfo conn={tflow.client_conn}/>),
            tree = connectionInfo.toJSON()
        expect(tree).toMatchSnapshot()
    })
})

describe('CertificateInfo Component', () => {
    it('should render correctly', () => {
        let certificateInfo = renderer.create(<CertificateInfo flow={tflow}/>),
            tree = certificateInfo.toJSON()
        expect(tree).toMatchSnapshot()
    })
})

describe('Timing Component', () => {
    it('should render correctly', () => {
        let timing = renderer.create(<Timing flow={tflow}/>),
            tree = timing.toJSON()
        expect(tree).toMatchSnapshot()
    })
})

describe('Details Component', () => {
    it('should render correctly', () => {
        let details = renderer.create(<Details flow={tflow}/>),
            tree = details.toJSON()
        expect(tree).toMatchSnapshot()
    })
})