mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-22 07:08:10 +00:00
[web] Update tests for js/components/ContentView/ContentViewOptions.jsx
This commit is contained in:
parent
ef9ee67c19
commit
950810accb
@ -3,6 +3,7 @@ import renderer from 'react-test-renderer'
|
||||
import ContentViewOptions from '../../../components/ContentView/ContentViewOptions'
|
||||
import { Provider } from 'react-redux'
|
||||
import { TFlow, TStore } from '../../ducks/tutils'
|
||||
import { uploadContent } from '../../../ducks/flows'
|
||||
|
||||
let tflow = new TFlow()
|
||||
|
||||
@ -11,7 +12,7 @@ describe('ContentViewOptions Component', () => {
|
||||
it('should render correctly', () => {
|
||||
let provider = renderer.create(
|
||||
<Provider store={store}>
|
||||
<ContentViewOptions flow={tflow} message={tflow.response}/>
|
||||
<ContentViewOptions flow={tflow} message={tflow.response} uploadContent={uploadContent}/>
|
||||
</Provider>),
|
||||
tree = provider.toJSON()
|
||||
expect(tree).toMatchSnapshot()
|
||||
|
@ -4,7 +4,6 @@ import { connect } from 'react-redux'
|
||||
import ViewSelector from './ViewSelector'
|
||||
import UploadContentButton from './UploadContentButton'
|
||||
import DownloadContentButton from './DownloadContentButton'
|
||||
import { uploadContent } from '../../ducks/flows'
|
||||
|
||||
ContentViewOptions.propTypes = {
|
||||
flow: PropTypes.object.isRequired,
|
||||
@ -29,8 +28,5 @@ export default connect(
|
||||
state => ({
|
||||
contentViewDescription: state.ui.flow.viewDescription,
|
||||
readonly: !state.ui.flow.modifiedFlow,
|
||||
}),
|
||||
{
|
||||
uploadContent: uploadContent
|
||||
}
|
||||
})
|
||||
)(ContentViewOptions)
|
||||
|
Loading…
Reference in New Issue
Block a user