bito-code-review[bot] commented on code in PR #37891:
URL: https://github.com/apache/superset/pull/37891#discussion_r2812254853
##########
superset-frontend/src/dashboard/components/gridComponents/Markdown/Markdown.test.tsx:
##########
@@ -409,9 +430,8 @@ test('shouldFocusMarkdown keeps focus when clicking on menu
items', async () =>
const editButton = screen.getByText('Edit');
userEvent.click(editButton);
- await new Promise(resolve => setTimeout(resolve, 50));
- expect(screen.queryByRole('textbox')).toBeInTheDocument();
+ expect(await screen.findByRole('textbox')).toBeInTheDocument();
Review Comment:
<div>
<div id="suggestion">
<div id="issue"><b>Test assertion incomplete</b></div>
<div id="fix">
The test 'shouldFocusMarkdown keeps focus when clicking on menu items' only
verifies that the textbox remains in the document, but does not check that
focus is actually maintained on the textbox. Per testing guidelines, assertions
should validate the claimed behavior logic directly rather than just component
rendering.
</div>
<details>
<summary>
<b>Code suggestion</b>
</summary>
<blockquote>Check the AI-generated fix before applying</blockquote>
<div id="code">
````suggestion
const textbox = await screen.findByRole('textbox');
expect(textbox).toBeInTheDocument();
expect(textbox).toHaveFocus();
````
</div>
</details>
</div>
<small><i>Code Review Run #508b66</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]