Skip to content

Instantly share code, notes, and snippets.

@kloy
Last active December 17, 2015 01:35
Show Gist options
  • Save kloy/3d0dafe1f6974f88c909 to your computer and use it in GitHub Desktop.
Save kloy/3d0dafe1f6974f88c909 to your computer and use it in GitHub Desktop.
'should change isLoading when matters fetched'.test(() => {
mockStore.dispatch(actions.fetchMatters({
route: 'matters',
initial: true,
}));
mockPromises.tick();
expect(mockStore.getState().mattersView).toEqual({
...mattersViewFixture,
fetchStates: 'LOADING',
});
expect(requests.length).toBe(1);
const request = requests[0];
request.respond(200, null, JSON.stringify(fixture.list));
mockPromises.tick();
expect(request.url).toBe('/matters');
expect(request.method).toBe('GET');
expect(mockStore.getState().mattersView).toEqual(mattersViewFixture);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment