Created
October 18, 2015 05:22
-
-
Save JakeSidSmith/8f6fc92fd3b654b24a11 to your computer and use it in GitHub Desktop.
Wrapper for testing nested smart redux components with jest
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let preprops = { | |
foo: 'bar' | |
}; | |
spyOn(Redux, 'connect').andReturn(function (UnconnectedComponent) { | |
return class Prepropulator extends React.Component { | |
render() { | |
let props = Object.assign({}, this.props, preprops); | |
return ( | |
<UnconnectedComponent {...props} /> | |
); | |
} | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment