diff --git a/src/screens/UserPortal/Donate/Donate.test.tsx b/src/screens/UserPortal/Donate/Donate.test.tsx index 1f78e63b80..5835f94a51 100644 --- a/src/screens/UserPortal/Donate/Donate.test.tsx +++ b/src/screens/UserPortal/Donate/Donate.test.tsx @@ -122,6 +122,7 @@ const MOCKS = [ }, ]; + const link = new StaticMockLink(MOCKS, true); async function wait(ms = 100): Promise { @@ -138,22 +139,6 @@ jest.mock('react-router-dom', () => ({ useParams: () => ({ orgId: '' }), })); -jest.mock('react-i18next', () => ({ - // This mock makes sure any components using the translate hook can use it without a warning being shown - useTranslation: () => { - return { - t: (str: string) => str, - i18n: { - changeLanguage: () => - new Promise(() => { - // This is an intentionally empty function - // It's used to mock the changeLanguage method without actually doing anything - }), - }, - }; - }, -})); - jest.mock('react-toastify', () => ({ toast: { error: jest.fn(), @@ -325,7 +310,7 @@ describe('Testing Donate Screen [User Portal]', () => { await wait(); - expect(toast.error).toHaveBeenCalledWith('invalidAmount'); + expect(toast.error).toHaveBeenCalledWith("Please enter a numerical value for the donation amount."); }); test('displays error toast for invalid (non-numeric) donation amount', async () => { @@ -348,6 +333,6 @@ describe('Testing Donate Screen [User Portal]', () => { await wait(); - expect(toast.error).toHaveBeenCalledWith('invalidAmount'); + expect(toast.error).toHaveBeenCalledWith("Please enter a numerical value for the donation amount."); }); });