I have a component SampleComponent that mounts another \"connected component\" (i.e. container). When I try to test SampleComponent by
You can use name export to solve this problem:
You should have:
class SampleComponent extends React.Component{
...
render(){
}
}
export default connect(mapStateToProps, mapDispatchToProps)(SampleComponent)
You can add a export before class:
export class SampleComponent extends React.Component{
and import this component with no redux store:
import { SampleComponent } from 'your-path/SampleComponent';
With this solution you don't need to import store to your test files.