Tag Archive

Tag Archives for " react "

Test Clicks On Connected Components In Under 10 Lines of Code

Here’s a fairly benign component, that can give developers pause when its time to write unit tests for your components:  const ClickableButton = props => ( <button onClick={props.doSomething}>Click Me!</button> ) const mapDispatchToProps () => ({ doSomething: dispatch(someFancyAction()) }) export default connect( null, mapDispatchToProps, )(ClickableButton) There is only thing worth testing here: That when we click […]

Continue reading