Skip to content

Fix Tom Select timing issues in meeting_spec.rb#2597

Open
mroderick wants to merge 1 commit intocodebar:masterfrom
mroderick:fix-tom-select-timing-2
Open

Fix Tom Select timing issues in meeting_spec.rb#2597
mroderick wants to merge 1 commit intocodebar:masterfrom
mroderick:fix-tom-select-timing-2

Conversation

@mroderick
Copy link
Copy Markdown
Collaborator

This PR fixes the flaky Tom Select tests in meeting_spec.rb.

Problem

The meeting edit page wasn't initializing Tom Select automatically, causing tests to fail with:

  • Unable to find css ".ts-wrapper"
  • Element interception issues when clicking dropdown options

Solution

  • Added ensure_tom_select_initialized helper method that manually initializes TomSelect if it hasn't been initialized within 2 seconds
  • Increased wait times for TomSelect initialization (10s)
  • Used JavaScript click for dropdown options to avoid element interception
  • Added explicit waits for items to be present before trying to remove them

Tests Fixed

  • spec/features/admin/meeting_spec.rb:51 - updating an existing meeting successfully
  • spec/features/admin/meeting_spec.rb:65 - adding an organiser

The meeting edit page wasn't initializing Tom Select automatically.
Added a helper method to manually initialize TomSelect if it hasn't
been initialized within 2 seconds of page load.

Also fixed:
- Longer wait times for TomSelect initialization (10s)
- JavaScript click for dropdown options to avoid element interception
- Explicit waits for items to be present before trying to remove them
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