-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
ref(performance): Remove usage of deprecatedRouteProps
from VitalDetail
#100923
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
const mockNavigate = jest.fn(); | ||
jest.mock('sentry/utils/useNavigate', () => ({ | ||
useNavigate: () => mockNavigate, | ||
})); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can also get the router back instead of mocking const {router} = render(<>)
to do
expect(router.location).toEqual(something)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, will switch over to that
const mockNavigate = jest.fn(); | ||
jest.mock('sentry/utils/useNavigate', () => ({ | ||
useNavigate: () => mockNavigate, | ||
})); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
const mockNavigate = jest.fn(); | |
jest.mock('sentry/utils/useNavigate', () => ({ | |
useNavigate: () => mockNavigate, | |
})); | |
jest.mock('sentry/utils/useNavigate', () => ({ | |
useNavigate: () => jest.fn(), | |
})); | |
seems to follow the rest of the codebase
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
didn't do this only because i'm binding mockNavigate
in order to expect toHaveBeenCalledWith
s on it later
Migrates usage of
deprecatedRouteProps
forVitalDetail
-sentry/views/performance/vitalDetail
.https://www.notion.so/sentry/Frontend-TSC-Project-Remove-all-uses-of-deprecatedRouteProps-true-26a8b10e4b5d8015a6a2dd14f9d41dd7