aminghadersohi commented on code in PR #43310:
URL: https://github.com/apache/superset/pull/43310#discussion_r3815890852


##########
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:
   Fixed in 8f042cc — added a top-level `afterEach(() => 
jest.restoreAllMocks())` rather than a trailing `mockRestore()`, since a 
trailing call would be skipped if an assertion throws.
   
   Also addressed the two additional suggestions in the same commit: the 
`.gradient-container` selector is now the semantic `getByRole('link')`, and 
`isNavigationHandledByLink` has direct coverage in `views/CRUD/utils.test.tsx` 
(link and nested children, non-link targets, an anchor without `href`, and 
non-element targets).



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