Skip to content

Commit

Permalink
fix: added usecase of options in test
Browse files Browse the repository at this point in the history
  • Loading branch information
bandhan-majumder committed Dec 2, 2024
1 parent 44d1174 commit 06a9a64
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/utils/errorHandler.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,15 @@ jest.mock('react-toastify', () => ({

describe('Test if errorHandler is working properly', () => {
const t: TFunction = (key: string) => key;
const tErrors: TFunction = (key: string, options?: Record<string, unknown>) =>
key;
const tErrors: TFunction = (
key: string,
options?: Record<string, unknown>,
) => {
if (options) {
console.log(`options are passed, but the function returns only ${key}`);
}
return key;
};

it('should call toast.error with the correct message if error message is "Failed to fetch"', () => {
const error = new Error('Failed to fetch');
Expand Down

0 comments on commit 06a9a64

Please sign in to comment.