Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- it('expected actions should be dispatched on successful request', () => {
- moxios.stubRequest('http://localhost:3001/activities', {
- status: 200,
- response: []
- });
- const store = mockStore({})
- const expectedActions = [
- 'ACTIVITY_PENDING',
- 'ACTIVITY_GET_ALL'
- ];
- return store.dispatch(actions.getActivities({}))
- .then(() => {
- const actualActions = store.getActions().map(action => action.type)
- expect(actualActions).toEqual(expectedActions)
- })
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement