I have used redux-mock-store, react-redux, enzyme and chai.
For example:
singup
class Signup extends Component { ... }
Signup = reduxForm({
form: 'newUser',
fields: ['email', 'password', 'confirmPassword']
})(Signup);
Signup = connect(null, actions)(Signup);
export default Signup;
signup.test
import React from 'react';
import { shallow, mount } from 'enzyme';
import { expect } from 'chai';
import configureStore from 'redux-mock-store';
import { Provider } from 'react-redux';
import Signup from '../src/components/signup';
let wrapper;
const mockStore = configureStore([]);
const store = mockStore({});
describe('Signup', () => {
beforeEach(() => {
wrapper = mount(
<Provider store={store}>
<Signup />
</Provider>
);
});
it ('should have signup className', () => {
expect(wrapper.find('.signup')).to.have.length(1);
});
});