import {createMemoryHistory, Route, Router, RouterContext} from 'react-router'; import {render} from 'sentry-test/reactTestingLibrary'; import {useNavigate} from 'sentry/utils/useNavigate'; import {RouteContext} from 'sentry/views/routeContext'; describe('useNavigate', () => { it('returns the navigate function', function () { let navigate; function HomePage() { navigate = useNavigate(); return null; } const memoryHistory = createMemoryHistory(); memoryHistory.push('/'); render( { return ( ); }} > ); expect(typeof navigate).toBe('function'); }); });