Skip to content

Commit

Permalink
Add role=status to points regions (#74)
Browse files Browse the repository at this point in the history
* Add role=status to points regions

[CORE-417]

* Snapshots
  • Loading branch information
RoyEJohnson authored Sep 24, 2024
1 parent 37e3f8c commit 9c213ed
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/ExerciseQuestion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export const ExerciseQuestion = React.forwardRef((props: ExerciseQuestionProps,
</Question>
<StepCardFooter className="step-card-footer">
<div className="step-card-footer-inner">
<div className="points">
<div className="points" role="status">
{available_points ? <strong>Points: {available_points}</strong> : null}
<span className="attempts-left">
{hasMultipleAttempts &&
Expand Down
2 changes: 1 addition & 1 deletion src/components/FreeResponseInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export const FreeResponseInput = (props: FreeResponseProps) => {
</div>
<StepCardFooter>
{availablePoints
? <div className="points"><strong>Points: {availablePoints}</strong></div>
? <div className="points" role="status"><strong>Points: {availablePoints}</strong></div>
: null}
<div className="controls">
<RevertButton disabled={!textHasChanged} onClick={cancelHandler} />
Expand Down
5 changes: 5 additions & 0 deletions src/components/__snapshots__/Exercise.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ exports[`Exercise using step data matches snapshot 1`] = `
>
<div
className="points"
role="status"
>
<span
className="attempts-left"
Expand Down Expand Up @@ -372,6 +373,7 @@ exports[`Exercise with question state data matches snapshot 1`] = `
>
<div
className="points"
role="status"
>
<span
className="attempts-left"
Expand Down Expand Up @@ -708,6 +710,7 @@ exports[`Exercise with question state data renders header icons with multiple ch
>
<div
className="points"
role="status"
>
<span
className="attempts-left"
Expand Down Expand Up @@ -1084,6 +1087,7 @@ exports[`Exercise with question state data renders header icons with two-step ex
>
<div
className="points"
role="status"
>
<span
className="attempts-left"
Expand Down Expand Up @@ -1280,6 +1284,7 @@ exports[`Exercise with question state data shows a detailed solution 1`] = `
>
<div
className="points"
role="status"
>
<span
className="attempts-left"
Expand Down
9 changes: 9 additions & 0 deletions src/components/__snapshots__/ExerciseQuestion.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ exports[`ExerciseQuestion matches snapshot 1`] = `
>
<div
className="points"
role="status"
>
<strong>
Points:
Expand Down Expand Up @@ -282,6 +283,7 @@ exports[`ExerciseQuestion renders Re-submit button 1`] = `
>
<div
className="points"
role="status"
>
<strong>
Points:
Expand Down Expand Up @@ -440,6 +442,7 @@ exports[`ExerciseQuestion renders Save button 1`] = `
>
<div
className="points"
role="status"
>
<strong>
Points:
Expand Down Expand Up @@ -592,6 +595,7 @@ exports[`ExerciseQuestion renders all attempts remaining 1`] = `
>
<div
className="points"
role="status"
>
<strong>
Points:
Expand Down Expand Up @@ -756,6 +760,7 @@ exports[`ExerciseQuestion renders continue button (unused?) 1`] = `
>
<div
className="points"
role="status"
>
<strong>
Points:
Expand Down Expand Up @@ -901,6 +906,7 @@ exports[`ExerciseQuestion renders detailed solution and published comments 1`] =
>
<div
className="points"
role="status"
>
<strong>
Points:
Expand Down Expand Up @@ -1076,6 +1082,7 @@ exports[`ExerciseQuestion renders free response 1`] = `
>
<div
className="points"
role="status"
>
<strong>
Points:
Expand Down Expand Up @@ -1233,6 +1240,7 @@ exports[`ExerciseQuestion renders no attempts remaining 1`] = `
>
<div
className="points"
role="status"
>
<strong>
Points:
Expand Down Expand Up @@ -1390,6 +1398,7 @@ exports[`ExerciseQuestion renders some attempts remaining 1`] = `
>
<div
className="points"
role="status"
>
<strong>
Points:
Expand Down
3 changes: 3 additions & 0 deletions src/components/__snapshots__/FreeResponseInput.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ exports[`Free Response Input matches snapshot 1`] = `
>
<div
className="points"
role="status"
>
<strong>
Points:
Expand Down Expand Up @@ -128,6 +129,7 @@ exports[`Free Response Input renders leftInfoComponent component 1`] = `
>
<div
className="points"
role="status"
>
<strong>
Points:
Expand Down Expand Up @@ -210,6 +212,7 @@ exports[`Free Response Input renders word limit error 1`] = `
>
<div
className="points"
role="status"
>
<strong>
Points:
Expand Down

0 comments on commit 9c213ed

Please sign in to comment.