Skip to content

Fix Twilio phone number form validation test#6863

Merged
compwron merged 2 commits intorubyforgood:mainfrom
alanparmenter:fix/twilio-form-test
Apr 16, 2026
Merged

Fix Twilio phone number form validation test#6863
compwron merged 2 commits intorubyforgood:mainfrom
alanparmenter:fix/twilio-form-test

Conversation

@alanparmenter
Copy link
Copy Markdown
Contributor

What github issue is this PR for, if any?

No Issue. Change too small to require one, right? Last of the failing tests on main in my local environment...

What changed, and why?

Brittle browser form validation message assertion replaced with testing browser form validity state (:invalid). This to avoid locale-dependent test failures due to "Fill in" (UK English) and "Fill out" (USA English) inconsistency.

How is this tested? (please write rspec and jest tests!) 💖💪

NB UK locale.
Before:

Failures:

1) casa_org/edit requires Twilio Form to be filled in correctly
    Failure/Error: expect(message).to eq "Please fill out this field."
     
       expected: "Please fill out this field."
            got: "Please fill in this field."
     
       (compared using ==)

After:
Passes with "" as a phone number.
Fails with "01234567":

 # Capybara::ExpectationNotMet:
     #   expected to find css "#casa_org_twilio_phone_number:invalid" but there were no matches

Screenshots please :)

Screenshot 2026-04-16 at 03 00 01

Feelings gif (optional)

Very splendid cat with monocle and top hat in rain

@github-actions github-actions bot added ruby Pull requests that update Ruby code Tests! 🎉💖👏 labels Apr 16, 2026
Copy link
Copy Markdown
Collaborator

@compwron compwron left a comment

Choose a reason for hiding this comment

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

nice nice nice

@compwron compwron merged commit 10fb1a9 into rubyforgood:main Apr 16, 2026
11 checks passed
@alanparmenter alanparmenter deleted the fix/twilio-form-test branch April 16, 2026 15:41
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.

2 participants