[web] Update tests for js/components/ContentView/ContentViewOptions.jsx

This commit is contained in:
Matthew Shao 2017-06-02 09:19:44 +08:00
parent ef9ee67c19
commit 950810accb
2 changed files with 3 additions and 6 deletions

View File

@ -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()

View File

@ -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)