Skip to content

test: focus TomSelect input explicitly before typing - #2804

Open
mroderick wants to merge 1 commit into
masterfrom
fix/flaky-tom-select-meeting-spec
Open

test: focus TomSelect input explicitly before typing#2804
mroderick wants to merge 1 commit into
masterfrom
fix/flaky-tom-select-meeting-spec

Conversation

@mroderick

Copy link
Copy Markdown
Collaborator

Stabilises the select_from_tom_select helper against a flaky CI failure seen in spec/features/admin/meeting_spec.rb:65 (PR #2803, Group 2).

The failure occurred because the helper dispatched an input event to the TomSelect textbox before headless browsers had reliably focused it. When the textbox lacks focus, TomSelect can ignore the input event and the AJAX search never fires, so .ts-dropdown .option never appears.

Changes:

  • Wait for .ts-wrapper to confirm TomSelect has initialised.
  • Explicitly focus the .ts-control input via JavaScript before setting its value and dispatching the input event.

Related: #2803

@mroderick
mroderick marked this pull request as ready for review August 10, 2026 09:07
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