-
Notifications
You must be signed in to change notification settings - Fork 36
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
Make organisations field searchable #3172
Conversation
This helper module adds a few assertion methods that can be used across specs that test our custom autocomplete behaviours They're used here in a few updating permissions tests, and will be used in the next commit in new inviting users tests when adding autocomplete to the organisation field
This upgrades the organisations field in the page for inviting a new user to use the accessible autocomplete module (with progressive enhancement)
b0817b6
to
4cb1dae
Compare
|
||
should("not show an 'Add' button") { assert_no_selector "button", text: "Add" } | ||
|
||
should "reset the value of the select element when it no longer matches what's shown in the autocomplete input" do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How would you feel about extracting these tests into more "component" style tests? That way we'd only need to test it once as we're reusing the component across multiple pages.
As it stands we're testing this behaviour twice across the two integration tests. We could then restrict the two test files modified in this PR to only test a user inputting some text into the autocomplete and inviting a user.
assert_equal "addin", @autocomplete_input.value | ||
assert_equal @new_permission_to_grant.name, autocomplete_option.text | ||
assert_equal "", @select_element.value | ||
assert_resets_select_when_desynced_with_autocomplete( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we are going to go down a more abstracted approach with our tests, could we make method names for our helpers even more human readable? I know we're following the lead taken by Minitest here, but I'm not the biggest fan of the brevity of Minitest's DSL.
Also, forgive my ignorance but I'm not sure what desynced means!
f022db3
to
125ae44
Compare
This allows us to get away from testing this custom JavaScript behaviour in multiple integration tests. We might want to test that everything works without the add/add and finish buttons being present (it does)
125ae44
to
4e90458
Compare
This upgrades the organisations field in the page for inviting a new user to use the accessible autocomplete module (with progressive enhancement)
Screen recording
Before
Screen.Recording.2024-09-17.at.11.53.15.mov
After
Screen.Recording.2024-09-17.at.11.51.38.mov
This application is owned by the publishing platform team. Please let us know in #govuk-publishing-platform when you raise any PRs.
Follow these steps if you are doing a Rails upgrade.