Skip to content

Conversation

shashjar
Copy link
Member

@shashjar shashjar commented Oct 3, 2025

Migrates usage of deprecatedRouteProps for VitalDetail - sentry/views/performance/vitalDetail.

https://www.notion.so/sentry/Frontend-TSC-Project-Remove-all-uses-of-deprecatedRouteProps-true-26a8b10e4b5d8015a6a2dd14f9d41dd7

@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Oct 3, 2025
@shashjar shashjar marked this pull request as ready for review October 3, 2025 21:51
@shashjar shashjar requested a review from a team as a code owner October 3, 2025 21:51
Copy link

codecov bot commented Oct 3, 2025

⚠️ JUnit XML file not found

The CLI was unable to find any JUnit XML files to upload.
For more help, visit our troubleshooting guide.

Comment on lines 22 to 25
const mockNavigate = jest.fn();
jest.mock('sentry/utils/useNavigate', () => ({
useNavigate: () => mockNavigate,
}));
Copy link
Member

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)

Copy link
Member Author

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

Comment on lines 22 to 26
const mockNavigate = jest.fn();
jest.mock('sentry/utils/useNavigate', () => ({
useNavigate: () => mockNavigate,
}));

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit:

Suggested change
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

Copy link
Member Author

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 toHaveBeenCalledWiths on it later

@shashjar shashjar merged commit add2d3a into master Oct 6, 2025
46 checks passed
@shashjar shashjar deleted the remove-deprecatedRouteProps-VitalDetail branch October 6, 2025 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants