Add basic accessibility test coverage to Rapid Diffs
What does this MR do and why?
The goal of this MR was to add automated accessibility tests to ViewComponents for Rapid Diffs.However, I did encounter some setup difficulties that didn't allow me to add the test to component ruby tests right off the bat:
Then I realised that we do aim for a full accessibility test coverage for feature specs, and if I add the tests to Rapid Diffs components, I'd in the end have a double coverage. I don't think that's necessary. And given that no other components (HAML or Vue) are not to have accessibility tests on unit level, I opted out of that approach.
As the result, I added the tests on the feature level to a Commit page:
- There are two blocks - for a current implementation of diffs and for rapid diffs.
- I skipped violated rules, as this MR was to only and the test coverage and as the changes needed to fix the violations need some consideration (e.g. different colour palettes).
Good news is that found violations in both implementations have the same source. So one fix will cover both rapid and not-so-rapid diffs
Violations found:
rule violated | regular diffs | rapid diffs |
---|---|---|
color-contrast | ![]() |
style not yet applied |
link-name | ![]() |
![]() |
valid-lang | ![]() |
![]() |
link-in-text-block | known violation on the page, not related to diffs |
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
n/a
Before | After |
---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Run the feature specs for user_view_commits_spec.rb:
bin/rspec spec/features/commits/user_view_commits_spec.rb
Related to #456709 (closed)