mirror of
https://github.com/hanzoai/o11y.git
synced 2026-10-15 12:58:33 +00:00
* chore: support cmd click on all clickable items * chore: update test cases * feat: address review comments * feat: enhance navigation tests for middle mouse button interactions * refactor: update navigation handling to use safeNavigate with newTab option * feat: support opening links in new tab with modifier key in K8sPodsList and SideNav * chore: clean up environment variable usage in login utility and remove unused test file * refactor: update import order and adjust navigation call in AlertNotFound tests * chore: remove eslint disable * chore: move isModiferKey to app util file * feat: update buildAbsolutePath to handle empty relative path * chore: fix import error
29 lines
708 B
TypeScript
29 lines
708 B
TypeScript
// Mock for useSafeNavigate hook to avoid React Router version conflicts in tests
|
|
interface SafeNavigateOptions {
|
|
replace?: boolean;
|
|
state?: unknown;
|
|
newTab?: boolean;
|
|
}
|
|
|
|
interface SafeNavigateTo {
|
|
pathname?: string;
|
|
search?: string;
|
|
hash?: string;
|
|
}
|
|
|
|
type SafeNavigateToType = string | SafeNavigateTo;
|
|
|
|
interface UseSafeNavigateReturn {
|
|
safeNavigate: jest.MockedFunction<
|
|
(to: SafeNavigateToType, options?: SafeNavigateOptions) => void
|
|
>;
|
|
}
|
|
|
|
export const useSafeNavigate = (): UseSafeNavigateReturn => ({
|
|
safeNavigate: jest.fn(
|
|
(_to: SafeNavigateToType, _options?: SafeNavigateOptions) => {},
|
|
) as jest.MockedFunction<
|
|
(to: SafeNavigateToType, options?: SafeNavigateOptions) => void
|
|
>,
|
|
});
|