Advertisement
Guest User

Untitled

a guest
Mar 24th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. it('should return jobs not found response message given API return 404 error status code', async (done) => {
  2. const action$ = ActionsObservable.of(FetchJobListingActionCreator(fetchQuery));
  3. const fakeResponse = {
  4. response : {
  5. status: 404,
  6. data: {
  7. detail: JOBS_NOT_FOUND_RESPONSE
  8. }
  9. }
  10. };
  11. const api = {
  12. get: jest.fn(() => Promise.reject(fakeResponse))
  13. };
  14.  
  15. expect(await fetchJobListingEpic(action$, null, {api}).toPromise()).toEqual(FetchJobListingFailedActionCreator(null, {name: fakeResponse.response.status.toString(), message: fakeResponse.response.data.detail}));
  16. done();
  17. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement