Skip to content

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:

Screenshot_2024-06-10_at_18.39.57

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 Screenshot_2024-06-10_at_20.58.50 style not yet applied
link-name Screenshot_2024-06-10_at_21.15.07 Screenshot_2024-06-10_at_20.56.47
valid-lang Screenshot_2024-06-10_at_21.15.18 Screenshot_2024-06-10_at_20.57.05
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.

  1. Run the feature specs for user_view_commits_spec.rb: bin/rspec spec/features/commits/user_view_commits_spec.rb

Related to #456709 (closed)

Edited by Paulina Sedlak-Jakubowska

Merge request reports