Skip to content

Commit

Permalink
Update mock implementation of @scality/module-federation to use react…
Browse files Browse the repository at this point in the history
…-router's useNavigate
  • Loading branch information
hervedombya committed Jan 20, 2025
1 parent 6772971 commit 777140f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ui/src/setupTests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(() => {
Expand All @@ -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,
Expand Down

0 comments on commit 777140f

Please sign in to comment.