From 777140faec2031f04b2299e9aa6567cca9cc064e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Dombya?= <135591453+hervedombya@users.noreply.github.com> Date: Mon, 20 Jan 2025 11:42:05 +0100 Subject: [PATCH] Update mock implementation of @scality/module-federation to use react-router's useNavigate --- ui/src/setupTests.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ui/src/setupTests.tsx b/ui/src/setupTests.tsx index 6cd70607b3..bdb3672adb 100644 --- a/ui/src/setupTests.tsx +++ b/ui/src/setupTests.tsx @@ -222,6 +222,7 @@ export const mockShellAlerts = { jest.mock('@scality/module-federation', () => { const original = jest.requireActual('@scality/module-federation'); + const router = jest.requireActual('react-router'); return { ...original, useCurrentApp: jest.fn(() => { @@ -231,7 +232,7 @@ jest.mock('@scality/module-federation', () => { appHistoryBasePath: '', }; }), - useBasenameRelativeNavigate: jest.fn(() => jest.fn()), + useBasenameRelativeNavigate: router.useNavigate, ShellHooksProvider: ({ children }) => <>{children}, useShellHooks: () => mockShellHooks, useShellAlerts: () => mockShellAlerts,