Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- it('should return jobs not found response message given API return 404 error status code', async (done) => {
- const action$ = ActionsObservable.of(FetchJobListingActionCreator(fetchQuery));
- const fakeResponse = {
- response : {
- status: 404,
- data: {
- detail: JOBS_NOT_FOUND_RESPONSE
- }
- }
- };
- const api = {
- get: jest.fn(() => Promise.reject(fakeResponse))
- };
- expect(await fetchJobListingEpic(action$, null, {api}).toPromise()).toEqual(FetchJobListingFailedActionCreator(null, {name: fakeResponse.response.status.toString(), message: fakeResponse.response.data.detail}));
- done();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement