Skip to content
This repository was archived by the owner on Feb 10, 2025. It is now read-only.

Commit f0dd292

Browse files
committed
TILA-1519 a11y fixes
1 parent 12f2539 commit f0dd292

12 files changed

Lines changed: 22 additions & 18 deletions

File tree

ui/components/LoginFragment.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ const LoginFragment = ({
6969
return !profile && authEnabled ? (
7070
<Wrapper>
7171
<MediumButton
72-
iconLeft={<IconSignin />}
72+
iconLeft={<IconSignin aria-hidden="true" />}
7373
onClick={() => setShouldLogin(true)}
7474
aria-label={t("common:loginAlt")}
7575
>

ui/components/application/Stepper.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ const Stepper = ({ application }: Props): JSX.Element => {
150150
$current={isCurrent}
151151
aria-hidden="true"
152152
>
153-
{isReady ? <IconCheck /> : index + 1}
153+
{isReady ? <IconCheck aria-hidden="true" /> : index + 1}
154154
</Number>
155155
<Name $current={isCurrent} $disabled={isDisabled}>
156156
{t(`application:navigation.${page}`)}

ui/components/applicationEvent/ApplicationEvent.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ const ApplicationEvent = ({
317317
</SubHeadLine>
318318
<CheckboxWrapper>
319319
<Checkbox
320-
id="defaultPeriod"
320+
id={fieldName("defaultPeriod")}
321321
checked={selectionIsDefaultPeriod}
322322
label={`${t("application:Page1.defaultPeriodPrefix")} ${formatDate(
323323
applicationRound.reservationPeriodBegin

ui/components/form/Sorting.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ const Sorting = ({
8181
/>
8282
)}
8383
</OrderBtn>
84-
<label htmlFor="search-form__button--sorting">
84+
<label htmlFor="search-form__button--sorting-toggle-button">
8585
{t("searchResultList:sortButtonLabel")}:
8686
</label>
8787
</LeftBlock>

ui/components/index/ApplicationRoundCard.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const StyledContainer = styled(Container)`
4343
max-width: 100%;
4444
`;
4545

46-
const Name = styled(H4)`
46+
const Name = styled(H4).attrs({ as: "h3" })`
4747
margin-top: 0;
4848
margin-bottom: var(--spacing-2-xs);
4949
`;
@@ -111,7 +111,7 @@ const ApplicationRoundCard = ({ applicationRound }: Props): JSX.Element => {
111111
{state !== "past" && (
112112
<Link href={`/criteria/${applicationRound.pk}`} passHref>
113113
<StyledLink>
114-
<IconArrowRight />
114+
<IconArrowRight aria-hidden="true" />
115115
{t("applicationRound:card.criteria")}
116116
</StyledLink>
117117
</Link>

ui/components/reservation-unit/Address.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const Container = styled.div`
1919
margin-bottom: var(--spacing-layout-l);
2020
`;
2121

22-
const Name = styled(H4)`
22+
const Name = styled(H4).attrs({ as: "h3" })`
2323
margin-top: 0;
2424
`;
2525

ui/components/reservation-unit/Head.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,10 @@ const Head = ({
158158
<BreadcrumbWrapper
159159
route={[
160160
viewType === "recurring" ? "/recurring" : "",
161-
`/${searchUrlWithParams}`,
161+
searchUrlWithParams,
162162
"reservationUnit",
163163
]}
164-
aliases={[
165-
{ slug: `/${searchUrlWithParams}`, title: t("breadcrumb:search") },
166-
]}
164+
aliases={[{ slug: searchUrlWithParams, title: t("breadcrumb:search") }]}
167165
/>
168166
<TopContainer>
169167
<Container>

ui/cypress/integration/recurring-lander.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe("recurring search lander", () => {
1919
.find("button")
2020
.should("contain.text", "Täytä hakemus");
2121
applicationRoundContainer("active")
22-
.children("h3")
22+
.children("h2")
2323
.should("contain.text", "Käynnissä olevat haut");
2424

2525
applicationRoundContainer("pending")
@@ -28,7 +28,7 @@ describe("recurring search lander", () => {
2828
.find("button")
2929
.should("not.exist");
3030
applicationRoundContainer("pending")
31-
.children("h3")
31+
.children("h2")
3232
.should("contain.text", "Tulevat haut");
3333

3434
applicationRoundContainer("past")
@@ -37,7 +37,7 @@ describe("recurring search lander", () => {
3737
.find("button")
3838
.should("not.exist");
3939
applicationRoundContainer("past")
40-
.children("h3")
40+
.children("h2")
4141
.should("contain.text", "Päättyneet haut");
4242

4343
cy.checkA11y(null, null, null, true);

ui/cypress/integration/reservation-unit.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ describe("Tilavaraus ui reservation unit page (recurring)", () => {
2525
addressContainer(1).should("contain", "Avaa kartta uuteen ikkunaan");
2626
addressContainer(1).should("contain", "Google reittiohjeet");
2727
addressContainer(1).should("contain", "HSL Reittiopas");
28+
29+
cy.injectAxe();
2830
});
2931

3032
describe("without equipment", () => {

ui/pages/intro.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ const Container = styled.div`
3939
display: grid;
4040
grid-template-columns: 1fr 382px;
4141
42+
#applicationRoundSelect-label {
43+
display: none;
44+
}
45+
4246
@media (max-width: ${breakpoint.l}) {
4347
grid-template-columns: 1fr;
4448
}
@@ -104,7 +108,7 @@ const Intro = (): JSX.Element => {
104108
id="applicationRoundSelect"
105109
placeholder={t("common:select")}
106110
options={applicationRounds as OptionType[]}
107-
label=""
111+
label={t("common:select")}
108112
onChange={(selection: OptionType): void => {
109113
setApplicationRound(selection.value as number);
110114
}}

0 commit comments

Comments
 (0)