Skip to content

Commit

Permalink
Add aria-label to correct/incorrect icons (#80)
Browse files Browse the repository at this point in the history
[CORE-416]
  • Loading branch information
RoyEJohnson authored Dec 10, 2024
1 parent 96854c2 commit f332eea
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
4 changes: 4 additions & 0 deletions src/components/ProgressBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,12 @@ const ItemIcon = ({ variant }: { variant: ProgressBarItemVariant }) => {
isCorrect: {
icon: faCheck,
color: colors.answer.correct,
label: 'Correct',
},
isIncorrect: {
icon: faXmark,
color: colors.answer.incorrect,
label: 'Incorrect',
},
}[variant];

Expand All @@ -112,6 +114,8 @@ const ItemIcon = ({ variant }: { variant: ProgressBarItemVariant }) => {
color={variantData.color}
height='16px'
width='16px'
aria-label={variantData.label}
aria-hidden={undefined}
/>;
}

Expand Down
18 changes: 9 additions & 9 deletions src/components/__snapshots__/ProgressBar.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ exports[`ProgressBar matches snapshot 1`] = `
1
</button>
<svg
aria-hidden="true"
aria-label="Incorrect"
className="svg-inline--fa fa-xmark sc-hKMtZM jnosjc"
color="#C22032"
data-icon="xmark"
Expand Down Expand Up @@ -49,7 +49,7 @@ exports[`ProgressBar matches snapshot 1`] = `
2
</button>
<svg
aria-hidden="true"
aria-label="Correct"
className="svg-inline--fa fa-check sc-hKMtZM cCtdaL"
color="#0D7741"
data-icon="check"
Expand Down Expand Up @@ -81,7 +81,7 @@ exports[`ProgressBar matches snapshot 1`] = `
3
</button>
<svg
aria-hidden="true"
aria-label="Incorrect"
className="svg-inline--fa fa-xmark sc-hKMtZM jnosjc"
color="#C22032"
data-icon="xmark"
Expand Down Expand Up @@ -180,7 +180,7 @@ exports[`ProgressBar matches snapshot when active step is incomplete 1`] = `
1
</button>
<svg
aria-hidden="true"
aria-label="Incorrect"
className="svg-inline--fa fa-xmark sc-hKMtZM jnosjc"
color="#C22032"
data-icon="xmark"
Expand Down Expand Up @@ -212,7 +212,7 @@ exports[`ProgressBar matches snapshot when active step is incomplete 1`] = `
2
</button>
<svg
aria-hidden="true"
aria-label="Correct"
className="svg-inline--fa fa-check sc-hKMtZM cCtdaL"
color="#0D7741"
data-icon="check"
Expand Down Expand Up @@ -244,7 +244,7 @@ exports[`ProgressBar matches snapshot when active step is incomplete 1`] = `
3
</button>
<svg
aria-hidden="true"
aria-label="Incorrect"
className="svg-inline--fa fa-xmark sc-hKMtZM jnosjc"
color="#C22032"
data-icon="xmark"
Expand Down Expand Up @@ -343,7 +343,7 @@ exports[`ProgressBar matches snapshot when status step is active 1`] = `
1
</button>
<svg
aria-hidden="true"
aria-label="Incorrect"
className="svg-inline--fa fa-xmark sc-hKMtZM jnosjc"
color="#C22032"
data-icon="xmark"
Expand Down Expand Up @@ -375,7 +375,7 @@ exports[`ProgressBar matches snapshot when status step is active 1`] = `
2
</button>
<svg
aria-hidden="true"
aria-label="Correct"
className="svg-inline--fa fa-check sc-hKMtZM cCtdaL"
color="#0D7741"
data-icon="check"
Expand Down Expand Up @@ -407,7 +407,7 @@ exports[`ProgressBar matches snapshot when status step is active 1`] = `
3
</button>
<svg
aria-hidden="true"
aria-label="Incorrect"
className="svg-inline--fa fa-xmark sc-hKMtZM jnosjc"
color="#C22032"
data-icon="xmark"
Expand Down

0 comments on commit f332eea

Please sign in to comment.