From f332eeadd0de484760a17f69efdbc684bc400bc7 Mon Sep 17 00:00:00 2001 From: Roy Johnson Date: Tue, 10 Dec 2024 10:53:53 -0600 Subject: [PATCH] Add aria-label to correct/incorrect icons (#80) [CORE-416] --- src/components/ProgressBar.tsx | 4 ++++ .../__snapshots__/ProgressBar.spec.tsx.snap | 18 +++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/components/ProgressBar.tsx b/src/components/ProgressBar.tsx index d3e0bca..6412cc7 100644 --- a/src/components/ProgressBar.tsx +++ b/src/components/ProgressBar.tsx @@ -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]; @@ -112,6 +114,8 @@ const ItemIcon = ({ variant }: { variant: ProgressBarItemVariant }) => { color={variantData.color} height='16px' width='16px' + aria-label={variantData.label} + aria-hidden={undefined} />; } diff --git a/src/components/__snapshots__/ProgressBar.spec.tsx.snap b/src/components/__snapshots__/ProgressBar.spec.tsx.snap index 4333ca5..7d6f3cd 100644 --- a/src/components/__snapshots__/ProgressBar.spec.tsx.snap +++ b/src/components/__snapshots__/ProgressBar.spec.tsx.snap @@ -17,7 +17,7 @@ exports[`ProgressBar matches snapshot 1`] = ` 1