Skip to content

Wait for options to be shown and to be removed when pressing Tab#3298

Merged
koesie10 merged 2 commits intomainfrom
koesie10/try-fix-flaky-suggestbox-tab
Jan 31, 2024
Merged

Wait for options to be shown and to be removed when pressing Tab#3298
koesie10 merged 2 commits intomainfrom
koesie10/try-fix-flaky-suggestbox-tab

Conversation

@koesie10
Copy link
Copy Markdown
Member

@koesie10 koesie10 commented Jan 31, 2024

This might fix the flaky test by adding some (conditional) waits for elements to appear and disappear.

Checklist

  • CHANGELOG.md has been updated to incorporate all user visible changes made by this pull request.
  • Issues have been created for any UI or other user-facing changes made by this pull request.
  • [Maintainers only] If this pull request makes user-facing changes that require documentation changes, open a corresponding docs pull request in the github/codeql repo and add the ready-for-doc-review label there.

@koesie10 koesie10 changed the title Wait for options to be shown before pressing Tab Wait for options to be shown and to be removed when pressing Tab Jan 31, 2024
@koesie10 koesie10 marked this pull request as ready for review January 31, 2024 12:58
@koesie10 koesie10 requested a review from a team as a code owner January 31, 2024 12:58
@koesie10 koesie10 requested a review from a team January 31, 2024 12:58
Copy link
Copy Markdown
Contributor

@shati-patel shati-patel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely looks plausible!


await userEvent.keyboard("{Enter}");

expect(screen.queryByRole("option")).not.toBeInTheDocument();
Copy link
Copy Markdown
Contributor

@shati-patel shati-patel Jan 31, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to waitFor this expect(screen.queryByRole("option")).not.toBeInTheDocument(); too?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't seem like it. I haven't seen this fail for Enter, only for Tab.

@koesie10 koesie10 merged commit b3284d6 into main Jan 31, 2024
@koesie10 koesie10 deleted the koesie10/try-fix-flaky-suggestbox-tab branch January 31, 2024 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants