bito-code-review[bot] commented on code in PR #40032:
URL: https://github.com/apache/superset/pull/40032#discussion_r3462400265
##########
superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx:
##########
@@ -1658,3 +1658,42 @@ test('renders standard Select dropdown when operatorType
is Exact', () => {
expect(screen.getAllByRole('combobox').length).toBeGreaterThan(0);
});
+
+test('renders dashboard select dropdown popup under document body', async ()
=> {
+ jest.useFakeTimers({ advanceTimers: true });
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Missing timer cleanup in async test</b></div>
<div id="fix">
The test enables fake timers at line 1663 but has no corresponding cleanup.
Compare with other tests in this file (lines 721, 798, 875, 952, 1029, 1100)
which call `jest.useRealTimers()` after each test. Without cleanup, subsequent
tests inherit fake timer state, causing `setTimeout`/`setInterval` callbacks to
fire unexpectedly and producing flaky or incorrect behavior.
</div>
<details>
<summary>
<b>Code suggestion</b>
</summary>
<blockquote>Check the AI-generated fix before applying</blockquote>
<div id="code">
```
---
superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx
+++
superset-frontend/src/filters/components/Select/SelectFilterPlugin.test.tsx
@@ -1696,5 +1696,6 @@ test('renders dashboard select dropdown popup under
document body', async () => {
expect(dropdown).toBeDefined();
});
expect(dropdown?.parentElement).toBe(document.body);
+ jest.useRealTimers();
});
```
</div>
</details>
</div>
<small><i>Code Review Run #3bc0d3</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]