Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: flaky case_contact index #5885

Merged

Conversation

elasticspoon
Copy link
Collaborator

@elasticspoon elasticspoon commented Jul 6, 2024

Potentially unflakes the test.

  1) case_contacts/index with case contacts without filter displays the contact type groups
     Failure/Error: expect(page).to have_text(case_contacts[2].contact_groups_with_types.keys.first)
       expected to find text "Group 1388" in "Group 1389\nDraft"

My theory is that sometimes the draft would appear before the real test because both were using Time.zone.today for the time. Looking at what the test is asserting more closely it doesn't actually make sense to check the first contact type group. All that matters is the overall presence of the group on the page.

I hardcoded more values to improve consistency.

@github-actions github-actions bot added ruby Pull requests that update Ruby code Tests! 🎉💖👏 labels Jul 6, 2024
Potentially unflakes the test. My theory is that sometimes the draft
would appear before the real test because both were using
Time.zone.today for the time.

I hardcoded more values to improve consistency.
@elasticspoon elasticspoon marked this pull request as ready for review July 6, 2024 01:52
@elasticspoon elasticspoon enabled auto-merge (squash) July 6, 2024 03:01
@elasticspoon elasticspoon merged commit a4d983d into rubyforgood:main Jul 6, 2024
17 checks passed
@elasticspoon elasticspoon deleted the fix/flaky-case_contact-index branch July 6, 2024 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ruby Pull requests that update Ruby code Tests! 🎉💖👏
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant