Skip to content

Commit 7560ba8

Browse files
fix: add heading tags to B2B org section (#3347)
1 parent e586766 commit 7560ba8

3 files changed

Lines changed: 25 additions & 6 deletions

File tree

frontends/main/src/app-pages/DashboardPage/ContractContent.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,9 @@ const WelcomeMessage: React.FC<{ contract?: ContractPage }> = ({
156156
return (
157157
<Stack gap="12px" paddingTop="40px" paddingBottom="24px">
158158
<Stack direction="row" justifyContent="space-between" alignItems="center">
159-
<Typography variant="h5">{welcomeMessage}</Typography>
159+
<Typography variant="h5" component="h2">
160+
{welcomeMessage}
161+
</Typography>
160162
<Link
161163
scroll={false}
162164
color="red"
@@ -775,7 +777,7 @@ const ContractContentInternal: React.FC<ContractContentInternalProps> = ({
775777
</ProgramCollectionsList>
776778
{programsQuery.data?.results.length === 0 && (
777779
<HeaderRoot>
778-
<Typography variant="h3" component="h1">
780+
<Typography variant="h3" component="h2">
779781
No programs found
780782
</Typography>
781783
</HeaderRoot>

frontends/main/src/app-pages/DashboardPage/CoursewareDisplay/OrganizationCards.test.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ describe("OrganizationCards", () => {
7474
)
7575
})
7676
expect(elements.length).toBeGreaterThan(0)
77+
await screen.findByRole("heading", {
78+
name: `As a member of ${org.name} you have access to:`,
79+
})
7780
}
7881
})
7982

@@ -135,6 +138,13 @@ describe("OrganizationCards", () => {
135138
expect(screen.getAllByRole("link", { name: "Contract 2" })).toHaveLength(
136139
2,
137140
)
141+
// Contract names should be wrapped in heading elements
142+
expect(
143+
screen.getAllByRole("heading", { name: "Contract 1" }),
144+
).toHaveLength(2)
145+
expect(
146+
screen.getAllByRole("heading", { name: "Contract 2" }),
147+
).toHaveLength(2)
138148
})
139149

140150
it("renders Continue buttons with correct organization URLs", async () => {

frontends/main/src/app-pages/DashboardPage/CoursewareDisplay/OrganizationCards.tsx

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,11 @@ const CardRootStyled = styled(DashboardCardRoot)({
5656
},
5757
})
5858

59+
const ContractTitleHeading = styled.h3({
60+
margin: 0,
61+
width: "100%",
62+
})
63+
5964
const TitleLink = styled(Link)({
6065
width: "100%",
6166
})
@@ -107,9 +112,11 @@ const OrganizationContracts: React.FC<OrganizationContractsProps> = ({
107112
const href = contractView(org.slug.replace("org-", ""), contract.slug)
108113
return (
109114
<CardContent key={contract.id} direction="row">
110-
<TitleLink size="medium" color="black" href={href}>
111-
{contract.name}
112-
</TitleLink>
115+
<ContractTitleHeading>
116+
<TitleLink size="medium" color="black" href={href}>
117+
{contract.name}
118+
</TitleLink>
119+
</ContractTitleHeading>
113120
<CardButton size="small" href={href} endIcon={<RiArrowRightLine />}>
114121
Continue
115122
</CardButton>
@@ -127,7 +134,7 @@ const OrganizationContracts: React.FC<OrganizationContractsProps> = ({
127134
style={{ objectFit: "contain" }}
128135
/>
129136
</ImageContainer>
130-
<Typography variant="body2">
137+
<Typography variant="body2" component="h2">
131138
{"As a member of "}
132139
<Typography variant="subtitle2" component="span">
133140
{org.name}

0 commit comments

Comments
 (0)