How to use the redux-mock-store.initialState.mergeDeep function in redux-mock-store

To help you get started, we’ve selected a few redux-mock-store examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github shakacode / reactrails-react-native-client / __tests__ / bundles / comments / hocs / withIndexProps.js View on Github external
it('adds props to Index component', () => {
    const state = initialState.mergeDeep({
      commentsStore: {
        2: { id: 2, author: 'Justin', text: 'Another random comment' },
        3: { id: 3, author: 'John', text: 'Yet another random comment' },
        1: { id: 1, author: 'Alexey', text: 'Just some random comment' },
      },
    });
    const store = createStoreFromState(state);
    const Component = withIndexProps(Mock);
    const tree = renderer.create();
    expect(tree).toMatchSnapshot();
  });
});
github shakacode / reactrails-react-native-client / __tests__ / bundles / comments / hocs / withAddProps.js View on Github external
it('adds AddProps to a component', () => {
    const state = initialState.mergeDeep({
      commentForm: {
        author: 'Alexey',
        text: 'Random comment',
      },
    });
    const store = createStoreFromState(state);
    const Component = withAddProps(Mock);
    const tree = renderer.create();
    expect(tree).toMatchSnapshot();
  });
});

redux-mock-store

A mock store for testing your redux async action creators and middleware

MIT
Latest version published 5 years ago

Package Health Score

79 / 100
Full package analysis

Similar packages