Skip to content

Commit

Permalink
Fix test setup following modification of type predicate
Browse files Browse the repository at this point in the history
We need a message (via new Error), a body.message, and a
body.status_code to satisfy isApiError.
  • Loading branch information
rylnd committed Mar 10, 2020
1 parent a840667 commit 6ecc237
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ describe('error_to_toaster', () => {

test('dispatches an error toast given an ApiError with a message', () => {
const error = new ApiError('Internal Server Error');
error.body = { message: 'something bad happened' };
error.body = { message: 'something bad happened', status_code: 500 };

errorToToaster({ id: 'some-made-up-id', title: 'some title', error, dispatchToaster });
expect(dispatchToaster.mock.calls[0]).toEqual([
Expand Down

0 comments on commit 6ecc237

Please sign in to comment.