mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-23 00:01:36 +00:00
[web] Add tests for js/components/ContentView/UploadContentButton.jsx
This commit is contained in:
parent
c9a7286b60
commit
3d51595b27
@ -0,0 +1,12 @@
|
|||||||
|
import React from 'react'
|
||||||
|
import renderer from 'react-test-renderer'
|
||||||
|
import UploadContentButton from '../../../components/ContentView/UploadContentButton'
|
||||||
|
|
||||||
|
describe('UpdateContentButton Component', () => {
|
||||||
|
it('should render correctly', () => {
|
||||||
|
let uploadContentFn = jest.fn(),
|
||||||
|
uploadContentButton = renderer.create(<UploadContentButton uploadContent={uploadContentFn}/>),
|
||||||
|
tree = uploadContentButton.toJSON()
|
||||||
|
expect(tree).toMatchSnapshot()
|
||||||
|
})
|
||||||
|
})
|
@ -0,0 +1,19 @@
|
|||||||
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
|
exports[`UpdateContentButton Component should render correctly 1`] = `
|
||||||
|
<a
|
||||||
|
className="btn btn-default btn-xs"
|
||||||
|
href="#"
|
||||||
|
onClick={[Function]}
|
||||||
|
title="Upload a file to replace the content."
|
||||||
|
>
|
||||||
|
<i
|
||||||
|
className="fa fa-fw fa-upload"
|
||||||
|
/>
|
||||||
|
<input
|
||||||
|
className="hidden"
|
||||||
|
onChange={[Function]}
|
||||||
|
type="file"
|
||||||
|
/>
|
||||||
|
</a>
|
||||||
|
`;
|
@ -1,3 +1,4 @@
|
|||||||
|
import React from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import FileChooser from '../common/FileChooser'
|
import FileChooser from '../common/FileChooser'
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user