Skip to content

Commit

Permalink
useAPIErrorHandler: Stop testing react-intl internals
Browse files Browse the repository at this point in the history
  • Loading branch information
gu-stav committed Mar 15, 2023
1 parent b53f260 commit 7f11c8b
Showing 1 changed file with 4 additions and 1 deletion.
Expand Up @@ -4,6 +4,7 @@ import { formatAxiosError } from '..';

describe('formatAxiosError', () => {
test('serializes AxiosError', () => {
const spy = jest.fn((obj) => obj);
const error = new AxiosError(
'Error message',
'409',
Expand All @@ -15,7 +16,9 @@ describe('formatAxiosError', () => {
}
);

expect(formatAxiosError(error, { formatMessage: (obj) => obj })).toStrictEqual({
formatAxiosError(error, { formatMessage: spy });

expect(spy).toHaveBeenCalledWith({
defaultMessage: 'Error message',
id: 'apiError.Error message',
values: {
Expand Down

0 comments on commit 7f11c8b

Please sign in to comment.