Skip to content

Instantly share code, notes, and snippets.

@JakeSidSmith
Created October 18, 2015 05:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JakeSidSmith/8f6fc92fd3b654b24a11 to your computer and use it in GitHub Desktop.
Save JakeSidSmith/8f6fc92fd3b654b24a11 to your computer and use it in GitHub Desktop.
Wrapper for testing nested smart redux components with jest
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