Skip to content

Commit 8e59eec

Browse files
authored
add aria-label to PopoverItem (#64)
1 parent d7fef1e commit 8e59eec

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

src/components/ExerciseHeaderIcons.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,12 @@ interface PopoverItemProps {
6262
}
6363

6464
const PopoverItem = (props: PopoverItemProps) => (
65-
<ItemWrapper {...props.wrapperProps} mobile={props.mobile} desktop={props.desktop}>
65+
<ItemWrapper
66+
{...props.wrapperProps}
67+
mobile={props.mobile}
68+
desktop={props.desktop}
69+
aria-label={props.text}
70+
>
6671
<InnerWrapper>
6772
{props.children}
6873
<Popover className="popover right">

src/components/__snapshots__/Exercise.spec.tsx.snap

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@ exports[`Exercise with question state data renders header icons with multiple ch
495495
className="sc-iqcoie iCsHxN"
496496
>
497497
<a
498+
aria-label="View topic in textbook"
498499
className="sc-papXJ fAQnos"
499500
href="https://openstax.org"
500501
target="_blank"
@@ -534,6 +535,7 @@ exports[`Exercise with question state data renders header icons with multiple ch
534535
</div>
535536
</a>
536537
<a
538+
aria-label="Suggest a correction"
537539
className="sc-papXJ fAQnos"
538540
href="https://openstax.org"
539541
target="_blank"
@@ -831,6 +833,7 @@ exports[`Exercise with question state data renders header icons with two-step ex
831833
className="sc-iqcoie iCsHxN"
832834
>
833835
<a
836+
aria-label="View topic in textbook"
834837
className="sc-papXJ fAQnos"
835838
href="https://openstax.org"
836839
target="_blank"
@@ -870,6 +873,7 @@ exports[`Exercise with question state data renders header icons with two-step ex
870873
</div>
871874
</a>
872875
<a
876+
aria-label="Suggest a correction"
873877
className="sc-papXJ fAQnos"
874878
href="https://openstax.org"
875879
target="_blank"
@@ -909,6 +913,7 @@ exports[`Exercise with question state data renders header icons with two-step ex
909913
</div>
910914
</a>
911915
<div
916+
aria-label="In a two-step question, OpenStax asks for your own answer first, then gives multiple-choice options to help you assess your learnings. Recalling the answer to a question from memory helps you to retain things longer."
912917
className="sc-papXJ fAQnos"
913918
>
914919
<div

src/components/__snapshots__/ExerciseHeaderIcons.spec.tsx.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ exports[`ExerciseIcons matches snapshot 1`] = `
55
className="sc-hKMtZM gYevhA"
66
>
77
<a
8+
aria-label="View topic in textbook"
89
className="sc-bczRLJ kQJjcU"
910
href="https://openstax.org"
1011
target="_blank"
@@ -44,6 +45,7 @@ exports[`ExerciseIcons matches snapshot 1`] = `
4445
</div>
4546
</a>
4647
<a
48+
aria-label="Suggest a correction"
4749
className="sc-bczRLJ kQJjcU"
4850
href="https://openstax.org"
4951
target="_blank"
@@ -83,6 +85,7 @@ exports[`ExerciseIcons matches snapshot 1`] = `
8385
</div>
8486
</a>
8587
<div
88+
aria-label="Select the best answer from the given list of distractors. Your instructor may or may not allow multiple attempts."
8689
className="sc-bczRLJ kQJjcU"
8790
>
8891
<div

0 commit comments

Comments
 (0)