-
Notifications
You must be signed in to change notification settings - Fork 9
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
cleanup: Remove detour-route-selection and route-ladder-header-update test groups #2697
cleanup: Remove detour-route-selection and route-ladder-header-update test groups #2697
Conversation
…-update test groups
…-update test groups
…-update test groups
Coverage of commit
|
Coverage of commit
|
) | ||
} | ||
|
||
// TODO: delete old header after roll-out | ||
export const NewHeader = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about renaming NewHeader
to Header
in this PR? I think it should be renamed with this work, but understand if you'd want it in a new PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oooh additionally, beyond just changing the component name, the "new" label on the classnames will need changing. In hindsight, this should have been done in my work! I should have used the term "oldHeader" instead of going with "newHeader"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created a follow-up subtask for this in order to keep the diff for this smaller and easier to review. I could lump them together if you'd prefer.
<ExclamationTriangleFill aria-label="Route Alert" /> | ||
<div | ||
className="c-route-ladder__alert-icon" | ||
aria-label="Route Alert" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you teach me why the aria-label
needed moving?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test uses a selector that tries to find the route alert icon using byRole("generic", { name: "Route alert" })
. For reasons I don't fully understand, having the aria-label
on the bootstrap icon doesn't actually put the aria-label onto the rendered component, but putting it on the wrapping div
does.
I think this means that the new route ladder header route alert icon isn't doing accessibility quite right.
(FWIW - on main
right now, the test is testing the old route ladder header, because the test group defaults to not being enabled, so the new route ladder header wasn't being tested for accessibility or an alert icon)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reasons I don't fully understand, having the
aria-label
on the bootstrap icon doesn't actually put the aria-label onto the rendered component, but putting it on the wrappingdiv
does.
You could try setting aria-hidden={false}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But also, as I understand it, aria-label
should be used as a last resort. This wasn't known when this was originally implemented, but a better way to do this would be to add the label text as a visually hidden DOM node and linking it to the icon with aria-labelledby
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could attempt to make things smarter, where if aria-label
or aria-labelledby
is provided, we could not set the default aria-hidden
value, but I'm not sure it's worth it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but a better way to do this would be to add the label text as a visually hidden DOM node and linking it to the icon with
aria-labelledby
Want to either:
- pair on this?
- ...address as a follow-up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Want to either:
* pair on this? * ...address as a follow-up?
I'm good either way! Since it was old code, I'm also fine with how it is for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried aria-hidden={false}
and it still said Unable to find an accessible element with the role "generic" and name "Route Alert"
I also tried aria-labelledby
, but that gave this error:
Expected element to have accessible description:
/Active Detour/i
Received:
PR (into this branch for now) below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks for writing that follow-up sub-task for renaming the header. As for the aria-label
question, I feel the same as Kayla, that it can be left as-is for now, and addressed in the future if/when needed. But it's above and beyond what you need to cover here!
Asana Ticket: https://app.asana.com/0/1205385723132845/1207483512351237/f