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


##########
superset-frontend/src/explore/components/controls/CollectionControl/CollectionControl.test.tsx:
##########
@@ -20,6 +20,7 @@ import { render, screen, userEvent } from 
'spec/helpers/testing-library';
 import CollectionControl from '.';
 
 jest.mock('@superset-ui/chart-controls', () => ({
+  ...jest.requireActual('@superset-ui/chart-controls'),

Review Comment:
   <div>
   
   
   <div id="suggestion">
   <div id="issue"><b>Mock targets non-existent export</b></div>
   <div id="fix">
   
   The mock targets `InfoTooltip` from `@superset-ui/chart-controls`, but this 
component is not exported from that module. The actual source imports 
`InfoTooltip` from `@superset-ui/core/components` (see `ControlHeader.tsx:22`). 
This mock will have no effect and may cause test failures.
   </div>
   
   
   <details>
   <summary>
   <b>Code suggestion</b>
   </summary>
   <blockquote>Check the AI-generated fix before applying</blockquote>
   <div id="code">
   
   
   ```
    --- 
superset-frontend/src/explore/components/controls/CollectionControl/CollectionControl.test.tsx
    +++ 
superset-frontend/src/explore/components/controls/CollectionControl/CollectionControl.test.tsx
    @@ -19,7 +19,7 @@ import { render, screen, userEvent } from 
'spec/helpers/testing-library';
     import CollectionControl from '.';
    
     jest.mock('@superset-ui/chart-controls', () => ({
    -  ...jest.requireActual('@superset-ui/chart-controls'),
    +  ...jest.requireActual('@superset-ui/chart-controls'),
       InfoTooltip: (props: any) => (
         <button
           onClick={props.onClick}
           type="button"
           data-icon={props.icon}
           data-tooltip={props.tooltip}
         >
           {props.label}
         </button>
       ),
     }));
    
     jest.mock('@superset-ui/core/components', () => ({
       ...jest.requireActual('@superset-ui/core/components'),
       InfoTooltip: (props: any) => (
         <button
           onClick={props.onClick}
           type="button"
           data-icon={props.icon}
           data-tooltip={props.tooltip}
         >
           {props.label}
         </button>
       ),
     }));
   ```
   
   </div>
   </details>
   
   
   
   </div>
   
   
   
   
   <small><i>Code Review Run #f1b1a5</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