Jmax/lg 11294 add aria tags to cancel idv verify screen#9508
Conversation
aduth
left a comment
There was a problem hiding this comment.
I think it makes sense to have a unique label for each form and it's probably okay that those are the same as the button text, but I'm not sure I follow that the changes to how we compute accessible names are necessary. For a regression spec, I might imagine we could check for this using a new matcher that checks for unique names of landmarks if multiple of the same type exist in the page (form in this case). Something like expect(page).to have_unique_landmark_labels.
Will replace with a more general check, per slack conversation w/ Andrew Duthie
No new entries, but the .erb file changed enough to confuse brakeman about the three existing entries.
cb16209 to
57d5997
Compare
changelog: User-Facing Improvements,remote proofing,Added accessibility tag attributes to cancel screen
f05b1ce to
8d27610
Compare
aduth
left a comment
There was a problem hiding this comment.
Couple comments, but LGTM otherwise 👍
| ) | ||
|
|
||
| click_on t('idv.cancel.actions.keep_going') | ||
| expect(page).to have_unique_form_landmark_labels |
There was a problem hiding this comment.
I wonder if we could add this to the existing expect_page_to_have_no_accessibility_violations common helper? Maybe that'd start flagging issues with unrelated screens.
Not sure if it covers all the variations, but we have a spec which calls that helper for the IdV cancel screen:
identity-idp/spec/features/accessibility/idv_pages_spec.rb
Lines 16 to 23 in 2b7c12d
| match do |page| | ||
| labels = landmarks(page).map { |element| AccessibleName.new(page:).computed_name(element) } | ||
|
|
||
| labels.none?(&:nil?) && labels.uniq.length == labels.length |
There was a problem hiding this comment.
Do we need the first part of this condition? I think if we were to adapt this for other screens, we're more concerned with testing for unique labels if a page has more than one form, so if the page has only one form and it has a nil label, that seems fine?
There was a problem hiding this comment.
Mmmm. Maybe (labels.length == 1 || labels.none?(&:nil)) ?
There was a problem hiding this comment.
Yeah, though that doesn't check that the labels are unique across multiple forms. Originally I was thinking it'd be enough to keep the rest of the current logic (labels.uniq.length == labels.length) but that wouldn't flag if there was multiple forms and only one or some of them were labeled.
Maybe this?
labels.one? || labels.compact.uniq.length == labels.lengthCo-authored by Andrew Duthie <andrew.duthie@gsa.gov>
🎫 Ticket
LG-11294
🛠 Summary of changes
aria-labelattributes to the Rails-generated (via thebutton_tohelper)<form>tags for the buttons on the 'cancel IdV' screen (the buttons are 'No, keep going', 'Start over', and either 'Go to account page' or 'Exit <>'button_togenerated forms for aria attributes📜 Testing Plan
The review app for testing is here
👀 Screenshots
Start over button
Keep going button
Account page button