Skip to content

Instantly share code, notes, and snippets.

@kanerogers
Created May 30, 2016 10:30
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 kanerogers/b3c4bec8666e0bdab2138b7ee313f06d to your computer and use it in GitHub Desktop.
Save kanerogers/b3c4bec8666e0bdab2138b7ee313f06d to your computer and use it in GitHub Desktop.
// Continued from the gist above..
it('maps state to props correctly', () => {
const TEST_TODOS = [
{ id: 0, text: 'Learn Redux' },
{ id: 1, text: 'Learn TDD' },
];
const TEST_STATE = { todos: TEST_TODOS };
// Here's how Redux's connect method will define the props for your component.
const props = mapStateToProps(TEST_STATE);
expect(props.todos).to.eql(TEST_STATE); // Note the deep equality (eql) operator here.
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment