We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi @dmitry-zaets! Could you please point out why I cannot test a nested action like below:
import thunk from 'redux-thunk'; import configureMockStore from 'redux-mock-store'; const middlewares = [thunk]; const mockStore = configureMockStore(middlewares); const store = mockStore({ stream: {} }); const successAction = (type, data={}) => ({ type, payload: { ...data, isPending: false, } }); function handleOverrideSuccess(stream, overriddenValues) { return () => { const update = { ...stream, ...overriddenValues }; return store.dispatch(successAction( def.STREAM_OVERRIDE_SUCCESS, { stream: update } )); } } describe('Function `handleOverrideSuccess`', () => { it('should dispatch actions', () => { const expectedAction = successAction( def.STREAM_OVERRIDE_SUCCESS, { stream: {} } ); handleOverrideSuccess({}, {})(); const acts = store.getActions(); expect(acts[0]).toEqual(expectedAction); }); });
The text was updated successfully, but these errors were encountered:
Having modified the test suite as follows doesn't help also:
it('should dispatch actions', () => { const spy = jest.spyOn(store, 'dispatch'); handleOverrideSuccess({}, {})(); expect(spy).toHaveBeenCalled(); });
Sorry, something went wrong.
Take a look on https://redux-things.github.io/redux-actions-assertions/what_it_does.html and this issue for more details: #71
No branches or pull requests
Hi @dmitry-zaets!
Could you please point out why I cannot test a nested action like below:
The text was updated successfully, but these errors were encountered: