codeant-ai-for-open-source[bot] commented on code in PR #39461:
URL: https://github.com/apache/superset/pull/39461#discussion_r3484283811


##########
superset-frontend/src/explore/components/controls/DatasourceControl/DatasourceControl.test.tsx:
##########
@@ -59,10 +72,16 @@ afterEach(() => {
     }
   } finally {
     fetchMock.clearHistory().removeRoutes();
-    jest.restoreAllMocks();
+    jest.clearAllMocks(); // Clears mock history but keeps spy in place
   }
 });

Review Comment:
   ✅ **Customized review instruction saved!**
   
   **Instruction:**
   > In DatasourceControl test files, do not use a blanket `restoreAllMocks()` 
in `afterEach` when a module-scope `window.location` getter spy is 
intentionally restored in `afterAll`; only reset per-test state and preserve 
the shared spy until teardown.
   
   **Applied to:**
     - `superset-frontend/src/explore/components/controls/DatasourceControl/**`
   
   ---
   💡 *To manage or update this instruction, visit: [CodeAnt AI 
Settings](https://app.codeant.ai/org/settings/learnings)*



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