bito-code-review[bot] commented on PR #40036:
URL: https://github.com/apache/superset/pull/40036#issuecomment-4424254106
<!-- Bito Reply -->
The flagged issue is correct: `findAllByText` only guarantees at least one
match, so accessing `options[1]` assumes two or more elements exist, which
could fail if only one is rendered. To resolve, select the option directly
using its role instead of indexing an array. Here's the concise fix:
**superset-frontend/src/SqlLab/components/SaveDatasetModal/SaveDatasetModal.test.tsx**
```
// Pick an existing dataset (use the listbox item, not the input mirror)
await userEvent.click(await screen.findByRole('option', { name: 'coolest
table 0' }));
```
--
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]