Skip to content
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

Conversation

joshlarson
Copy link
Contributor

@joshlarson joshlarson marked this pull request as ready for review July 17, 2024 14:45
@joshlarson joshlarson requested a review from a team as a code owner July 17, 2024 14:45
Copy link

Coverage of commit 5f54a0a

Summary coverage rate:
  lines......: 93.6% (3308 of 3536 lines)
  functions..: 73.6% (1364 of 1854 functions)
  branches...: no data found

Files changed coverage rate: n/a

Download coverage report

Copy link

Coverage of commit 5f54a0a

Summary coverage rate:
  lines......: 93.6% (3309 of 3536 lines)
  functions..: 73.6% (1365 of 1854 functions)
  branches...: no data found

Files changed coverage rate: n/a

Download coverage report

)
}

// TODO: delete old header after roll-out
export const NewHeader = ({
Copy link
Collaborator

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

Copy link
Collaborator

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"

Copy link
Contributor Author

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"
Copy link
Collaborator

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?

Copy link
Contributor Author

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)

Copy link
Member

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 wrapping div does.

You could try setting aria-hidden={false}

Copy link
Member

@firestack firestack Jul 22, 2024

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

Copy link
Member

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.

Copy link
Contributor Author

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?

Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Collaborator

@hannahpurcell hannahpurcell left a 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!

@joshlarson joshlarson merged commit 656a63f into main Jul 24, 2024
90 checks passed
@joshlarson joshlarson deleted the jdl/cleanup/remove-detour-route-selection-and-new-ladder-header-test-groups branch July 24, 2024 13:59
joshlarson added a commit that referenced this pull request Jul 24, 2024
joshlarson added a commit that referenced this pull request Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants