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


##########
superset-frontend/src/pages/DatasetList/DatasetList.testHelpers.tsx:
##########
@@ -468,11 +449,13 @@ export const setupDuplicateErrorMocks = (statusCode: 
number) => {
  * @throws If any unmocked endpoints were called or expected endpoints weren't 
called
  */
 export const assertOnlyExpectedCalls = (expectedEndpoints: string[]) => {
-  const allCalls = fetchMock.calls(true); // Get all calls including unmatched
-  const unmatchedCalls = allCalls.filter(call => call.isUnmatched);
+  const allCalls = fetchMock.callHistory.calls();
+  const unmatchedCalls = allCalls.filter(
+    call => call.route?.config?.name === 'unmatched',

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Incorrect unmatched call detection</b></div>
   <div id="fix">
   
   The filter for unmatched calls checks for a route with name 'unmatched', but 
in fetch-mock v12, unmatched calls have route as undefined. This prevents 
detecting unmocked endpoints, potentially masking test issues.
   </div>
   
   
   <details>
   <summary>
   <b>Code suggestion</b>
   </summary>
   <blockquote>Check the AI-generated fix before applying</blockquote>
   <div id="code">
   
   
   ````suggestion
       call => call.route === undefined,
   ````
   
   </div>
   </details>
   
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #c84c92</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



##########
superset-frontend/src/pages/DatasetList/DatasetList.behavior.test.tsx:
##########
@@ -162,7 +162,7 @@ test('500 error triggers danger toast with error message', 
async () => {
 
   // Verify toast message contains error keywords
   expect(addDangerToast.mock.calls.length).toBeGreaterThan(0);
-  const toastMessage = String(addDangerToast.mock.calls[0][0]);
+  const toastMessage = String(addDangerToast.mock.calls[0].url);

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Incorrect Jest mock access</b></div>
   <div id="fix">
   
   Jest mock calls are arrays, not objects with .url property. This will cause 
test failures.
   </div>
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #c84c92</i></small>
   </div>
   
   ---
   Should Bito avoid suggestions like this for future reviews? (<a 
href=https://alpha.bito.ai/home/ai-agents/review-rules>Manage Rules</a>)
   - [ ] Yes, avoid them



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