bito-code-review[bot] commented on code in PR #43310:
URL: https://github.com/apache/superset/pull/43310#discussion_r3815892111


##########
superset-frontend/src/features/dashboards/DashboardCard.test.tsx:
##########
@@ -101,6 +102,43 @@ test('Renders the modified date', () => {
   expect(modifiedDateElement).toBeInTheDocument();
 });
 
+test('clicking the thumbnail navigates to the dashboard exactly once', () => {
+  // The cover is a router link and the whole card is clickable, so a click on
+  // the cover used to be handled twice and pushed two identical entries, which
+  // left the Back button popping the duplicate rather than returning the user
+  // to the page they came from.
+  jest.spyOn(global, 'fetch').mockResolvedValue({

Review Comment:
   <!-- Bito Reply -->
   The suggestion provided by the reviewer was appropriate and necessary to 
prevent cross-test pollution. By adding `jest.restoreAllMocks()` in an 
`afterEach` block, you have correctly ensured that the `fetch` spy is cleaned 
up after every test, regardless of whether an assertion throws. This is a 
standard best practice for managing test mocks in Jest.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to