-
-
Notifications
You must be signed in to change notification settings - Fork 8
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
Change to default EnforcedStyle: link_or_button
for Capybara/ClickLinkOrButtonStyle
cop
#76
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…LinkOrButtonStyle` cop Fix: #61 (comment) Fix: #61 (comment)
ydah
force-pushed
the
change_click_link_or_button_default
branch
from
October 2, 2023 13:26
465b87a
to
f94468d
Compare
ydah
requested review from
a team,
pirj,
bquorning and
Darhazer
and removed request for
a team
October 6, 2023 01:36
bquorning
approved these changes
Oct 11, 2023
11 tasks
For the record, this does not really fix my comment #61 (comment). |
enescakir
added a commit
to ubicloud/ubicloud
that referenced
this pull request
Jan 3, 2024
Dependabot sent a pull request for rubocop-related updates, and it failed because of new corrections that could be applied. This applies them, and then Dependabot's rebase of the rubocop update should succeed. The default value for `Capybara/ClickLinkOrButtonStyle` has been changed from `strict` to `link_or_button`, which has loosened its constraints. However, we have been adhering to the `strict` style. I've reverted it back to `strict` as the relaxed version necessitated numerous test changes, which I found to be unnecessary. rubocop/rubocop-capybara#76
enescakir
added a commit
to ubicloud/ubicloud
that referenced
this pull request
Jan 3, 2024
Dependabot sent a pull request for rubocop-related updates, and it failed because of new corrections that could be applied. This applies them, and then Dependabot's rebase of the rubocop update should succeed. The default value for `Capybara/ClickLinkOrButtonStyle` has been changed from `strict` to `link_or_button`, which has loosened its constraints. However, we have been adhering to the `strict` style. I've reverted it back to `strict` as the relaxed version necessitated numerous test changes, which I found to be unnecessary. rubocop/rubocop-capybara#76
zspencer
added a commit
to zinc-collective/convene
that referenced
this pull request
Jan 5, 2024
- rubocop/rubocop-capybara#76 I lean more towards @franzliedke's perspective that HTML is a semantic language, and [`<button>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button)/[`<input type="submit">`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/submit) and [`a`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a) have distinct purposes.. Strict mode allows us to be intentional about what the interaction is for (i.e. navigation? `click_link`! Manipulation? `click_button`!) That said, I don't know how clickable elements that are not links or buttons should work; for example the [`<details>`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details) tag?! Anyway, this also means we're not doing code changes with wishy-washy-defaults
G-Rath
added a commit
to ackama/rails-template
that referenced
this pull request
Jan 11, 2024
rubocop/rubocop-capybara#76 changed the default to enforce using the more generic `click_link_or_button` and `click_on` because > These methods offer a weaker coupling between the test and HTML, allowing for a more faithful reflection of how the user behaves. Which is very fair imo and inline with other testing frameworks like `testing-library`.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
partically fix: #61 (comment)
fix: #61 (comment)
Before submitting the PR make sure the following are checked:
main
(if not - rebase it).CHANGELOG.md
if the new code introduces user-observable changes.bundle exec rake
) passes (be sure to run this locally, since it may produce updated documentation that you will need to commit).If you have modified an existing cop's configuration options:
VersionChanged: "<<next>>"
inconfig/default.yml
.