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

Consider disambiguating text of links/buttons for "Register" and "Search" #4304

Open
jmartin-sul opened this issue Jan 9, 2024 · 0 comments

Comments

@jmartin-sul
Copy link
Member

jmartin-sul commented Jan 9, 2024

This seems like it might be a minor accessibility/navigability issue, but I'm not sure about that...

Rubocop advised us to switch from click_link and click_button to click_link_or_button. This broke some of the integration tests (see related infra integration test PR), because e.g. the registration form has a link to itself (via the nav header for all pages) with the "Register" text, but that's also the text of the button for submitting the form. Similarly for the "Search" button on the object view page. Per their docs for the ClickLinkOrButtonStyle rule:

Checks for methods of button or link clicks.

By default, prefer to use click_link_or_button or click_on. These methods offer a weaker coupling between the test and HTML, allowing for a more faithful reflection of how the user behaves.

Which, fair enough, but that's also a bit presumptuous for integration tests of existing UI. Maybe a good rule to keep for in-app feature tests so that we don't introduce more of this sort of ambiguity?

Also, for the cases we found where there are links and buttons with the same title in Argo, I'm guessing that this isn't a huge deal: I doubt that sighted users will confuse the "Register" nav link at the top of the page with the "Register" button that submits the form that the aforementioned link takes you to. And I'm guessing (though grain of salt since this isn't my area of expertise) that visually impaired users who are using screen readers will be able to easily tell from the context and from experience with other web apps that the nav link and the button have different purposes. Maybe the "Search" thing will be trickier, harder for me to judge that, since the "Search" links that got confused with the "Search" button didn't seem to be visible to me in the Argo show page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant