-
Notifications
You must be signed in to change notification settings - Fork 35
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 (take two) #3177
Conversation
7d6a10f
to
067f91c
Compare
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.
This looks good to me. With the distinct caveat that I am not a great Javascript dev, so it still might be worth a 3rd pair of eyes, maybe @Gweaton?
test/integration/updating_permissions_for_apps_with_many_permissions_test.rb
Outdated
Show resolved
Hide resolved
When improving the clear button for the accessible autocomplete component (0c5d5a1), we moved to integration tests using Capybara with Selenium, instead of unit tests with Jasmine. This was because the button was moved outside of the autocomplete module, which caused issues with Jasmine-based testing This slightly restructures the template where we use accessible autocomplete to wrap all the elements the JavaScript needs to access in the `div[data-module=accessible-autocomplete]` element. We then use dependency injection to pass the module to custom functions that enhance the form. These changes allow us to revert to the unit test approach, which in turn means we can introduce the autocomplete component into other templates without needing to test context-independent functionality in multiple integration test specs I've retained a couple of the JavaScript-enabled integration tests where they're more about checking everything works in a specific context
067f91c
to
170fc4f
Compare
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.
Looks good (if I say so myself), thanks for putting up with my arguable scope creep...
170fc4f
to
3ffc0cb
Compare
The tests in this file kept this DRY but were a little tricky to figure out at a glance what each test was doing. We've refactored them a fair bit to remove some of the abstractions and make them easier to read, while still looping over the two use cases of updating one's own permissions and updating those of another user. This refactor was prompted by the addition of a new Accessible Autocomplete component to the Organisations page. We've added a new AutocompleteHelper in this commit to perform some simple Autocomplete actions and prevent us needing to re-write a few lines of code to find and select an option. It's used here for updating permissions tests, and will be used in the next commit in inviting users tests when adding autocomplete to the organisation field. Apologies for multiple changes going on in this commit, it's essentially: - Adding a new Autocomplete Helper for reuse in other areas of the service that use the Accessible Autocomplete. - Refactoring the tests to use this new helper and to improve readability. Co-authored-by: George Eaton <george@dxw.com>
This upgrades the organisations field in the page for inviting a new user to use the accessible autocomplete module (with progressive enhancement) Co-authored-by: George Eaton <george@dxw.com>
3ffc0cb
to
0647a29
Compare
Trello
This upgrades the organisations field in the page for inviting a new user to use the accessible autocomplete module (with progressive enhancement)
This is reworked from and closes #3172
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.