bito-code-review[bot] commented on code in PR #38563:
URL: https://github.com/apache/superset/pull/38563#discussion_r2918081471
##########
superset-frontend/src/components/Chart/DrillBy/DrillByModal.test.tsx:
##########
@@ -440,7 +440,7 @@ describe('Table view with pagination', () => {
expect(nextPageButton).toBeInTheDocument();
// Click next page
- userEvent.click(nextPageButton);
+ await userEvent.click(nextPageButton);
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Inconsistent async userEvent.click usage</b></div>
<div id="fix">
The change correctly adds 'await' to userEvent.click, as this method is
asynchronous in @testing-library/user-event v12.8.3. However, 13 other
userEvent.click calls in this file lack 'await', which can cause inconsistent
test behavior and flakiness. All userEvent.click invocations should be awaited
to ensure events are fully processed before assertions.
</div>
</div>
<small><i>Code Review Run #5f870a</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/packages/superset-ui-core/src/components/AsyncEsmComponent/index.tsx:
##########
@@ -91,15 +87,14 @@ export function AsyncEsmComponent<
return promise;
}
- type AsyncComponent = ForwardRefExoticComponent<
- PropsWithoutRef<FullProps> & RefAttributes<ComponentType<FullProps>>
- > & {
+ type AsyncComponent = ReturnType<typeof forwardRef> & {
preload?: typeof waitForPromise;
};
+ // @ts-expect-error -- generic forwardRef has PropsWithoutRef
incompatibility with FullProps
const AsyncComponent: AsyncComponent = forwardRef(function AsyncComponent(
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Type alias redeclaration causes linter error</b></div>
<div id="fix">
The `AsyncComponent` type is declared twice: once as a type alias (line 90)
and again as a const variable (line 95). Remove the type alias declaration and
apply the type annotation directly to the const declaration to resolve the
redeclaration error.
</div>
<details>
<summary>
<b>Code suggestion</b>
</summary>
<blockquote>Check the AI-generated fix before applying</blockquote>
<div id="code">
````suggestion
// @ts-expect-error -- generic forwardRef has PropsWithoutRef
incompatibility with FullProps
const AsyncComponent: ReturnType<typeof forwardRef> & { preload?: typeof
waitForPromise } = forwardRef(function AsyncComponent(
````
</div>
</details>
</div>
<small><i>Code Review Run #5f870a</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]