fix: add heading tags to B2B org section#3347
Open
daniellefrappier18 wants to merge 2 commits into
Open
Conversation
OpenAPI ChangesNo changes detected Unexpected changes? Ensure your branch is up-to-date with |
Contributor
There was a problem hiding this comment.
Pull request overview
Improves screen reader accessibility on the B2B organization dashboard and contract detail views by introducing proper heading semantics and ensuring a consistent heading hierarchy under the page title.
Changes:
- Dashboard org section: renders the org access label as an
h2and each contract title as anh3. - Contract detail page: adjusts welcome message and empty-state headings to avoid skipped/duplicate heading levels.
- Adds RTL assertions to ensure the new headings are discoverable via
getByRole("heading").
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| frontends/main/src/app-pages/DashboardPage/CoursewareDisplay/OrganizationCards.tsx | Adds h2/h3 semantics for org section label and contract titles. |
| frontends/main/src/app-pages/DashboardPage/CoursewareDisplay/OrganizationCards.test.tsx | Adds tests asserting org and contract headings are accessible via heading roles. |
| frontends/main/src/app-pages/DashboardPage/ContractContent.tsx | Fixes heading levels for welcome message and “No programs found” states. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What are the relevant tickets?
Fixes https://github.com/mitodl/hq/issues/11297
Description (What does it do?)
Adds heading tags to the B2B organization section of the dashboard for screen reader accessibility. This is a follow-up to #3253, which added headings to the My Learning section.
h2, and each contract name link is wrapped in anh3, establishing a proper heading hierarchy beneath the page'sh1.variant="h5"which rendered as<h5>, skipping heading levels after the org nameh1. Fixed tocomponent="h2". The "No programs found" state had an incorrect duplicateh1and fixed toh2.getByRole("heading")assertions toOrganizationCards.test.tsxto verify both the org section and contract name headings are accessible.Screenshots (if appropriate):
BEFORE Dashboard Page

AFTER Dashboard Page

BEFORE Contact Page

AFTER Contact Page

How can this be tested?
Prerequisites:
This change is best verified by inspecting the DOM in browser DevTools:
<h2>element, and each contract name below it should be an<h3><h1><h2>Additional Context