Skip to content

test: Stabilise TomSelect helper against focus races - #2741

Merged
mroderick merged 1 commit into
masterfrom
fix/tomselect-flake
Jul 28, 2026
Merged

test: Stabilise TomSelect helper against focus races#2741
mroderick merged 1 commit into
masterfrom
fix/tomselect-flake

Conversation

@mroderick

Copy link
Copy Markdown
Collaborator

Fix a flaky failure in select_from_tom_select where Capybara clicks did not reliably focus the TomSelect input in headless CI, so the search AJAX was never triggered and the dropdown options never appeared.

The helper now:

  • scopes all selectors to the specific TomSelect via the from element ID
  • adds an explicit JavaScript focus call after clicking the input
  • requires from: in both helpers so the scoping is always explicit

Related: #2740

Validation:

  • bundle exec rspec spec/features/admin/ — 110 examples, 0 failures
  • bundle exec rubocop spec/support/select_from_tom_select.rb spec/features/admin/meeting_spec.rb — no offenses

Fix a flaky failure where Capybara clicks did not reliably

focus the TomSelect input in headless CI, so the search AJAX

was never triggered and the dropdown options never appeared.

Changes:

- Scope selectors to the specific TomSelect via `from`.

- Add an explicit JavaScript focus call after clicking.

- Require `from:` in both helpers for explicit scoping.
@mroderick
mroderick marked this pull request as ready for review July 28, 2026 06:51
@mroderick
mroderick merged commit 0983959 into master Jul 28, 2026
10 checks passed
@mroderick
mroderick deleted the fix/tomselect-flake branch July 28, 2026 06:52
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.

1 participant