Tag Archives: thunk

Testing a Redux Connected Component with Thunk Actions with Enzyme

Let’s say you’ve got a React component connected to a Redux store import React from ‘react’; import PropTypes from ‘prop-types’; import { connect } from ‘react-redux’; import { saveColor } from ‘../actions/save’; import ColorButtons from ‘../components/ColorButtons’; const ColorButtons = ({ colors, onClick }) => ( <div> {colors.map(color => { <button type=”button” key={color} onClick={onClick(color)}>{color}</button> })} </div> […]