aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/__tests__/components/ContentView/MetaViewsSpec.js
blob: 26b2a27cd5a66a1f809a9cdbbd8d6c036325a8c3 (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
import React from 'react'
import renderer from 'react-test-renderer'
import { ContentEmpty, ContentMissing, ContentTooLarge } from '../../../components/ContentView/MetaViews'
import { TFlow } from '../../ducks/tutils'

let tflow = new TFlow()

describe('ContentEmpty Components', () => {
    it('should render correctly', () => {
        let contentEmpty = renderer.create(<ContentEmpty flow={tflow} message={tflow.response}/>),
            tree = contentEmpty.toJSON()
        expect(tree).toMatchSnapshot()
    })
})

describe('ContentMissing Components', () => {
    it('should render correctly', () => {
        let contentMissing = renderer.create(<ContentMissing flow={tflow} message={tflow.response}/>),
            tree = contentMissing.toJSON()
        expect(tree).toMatchSnapshot()
    })
})

describe('ContentTooLarge Components', () => {
    it('should render correctly', () => {
        let clickFn = jest.fn(),
            uploadContentFn = jest.fn(),
            contentTooLarge = renderer.create(<ContentTooLarge
                flow={tflow}
                message={tflow.response}
                onClick={clickFn}
                uploadContent={uploadContentFn}
            />),
            tree = contentTooLarge.toJSON()
        expect(tree).toMatchSnapshot()
    })
})