bito-code-review[bot] commented on code in PR #33002: URL: https://github.com/apache/superset/pull/33002#discussion_r2323046267
########## superset-frontend/src/components/ListView/ListView.test.jsx: ########## @@ -26,6 +26,16 @@ import fetchMock from 'fetch-mock'; // Only import components that are directly referenced in tests import { ListView } from './ListView'; +// Mock DropdownButton to ensure it works properly in tests +jest.mock('@superset-ui/core/components', () => ({ + ...jest.requireActual('@superset-ui/core/components'), + DropdownButton: ({ children, onClick, 'data-test': dataTest, ...props }) => ( + <button onClick={onClick} data-test={dataTest} {...props}> + {children} + </button> + ), +})); Review Comment: <div> <div id="suggestion"> <div id="issue"><b>Incomplete mock component interface</b></div> <div id="fix"> The mock DropdownButton is missing critical props that the real component uses. The actual DropdownButton accepts `popupRender`, `loading`, `type`, and other Ant Design Dropdown.Button props, but the mock only handles basic props. This could cause tests to pass when they should fail or not properly test component behavior. Update the mock to handle these essential props. </div> <details> <summary> <b>Code suggestion</b> </summary> <blockquote>Check the AI-generated fix before applying</blockquote> <div id="code"> ```suggestion // Mock DropdownButton to ensure it works properly in tests jest.mock('@superset-ui/core/components', () => ({ ...jest.requireActual('@superset-ui/core/components'), DropdownButton: ({ children, onClick, 'data-test': dataTest, popupRender, loading, type, ...props }) => ( <button onClick={onClick} data-test={dataTest} disabled={loading} className={type} {...props}> {children} </button> ), })); ``` </div> </details> </div> <small><i>Code Review Run <a href=https://github.com/apache/superset/pull/33002#issuecomment-3254917199>#b48785</a></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: notifications-unsubscr...@superset.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org