Skip to content

Commit

Permalink
Make question info a heading (#82)
Browse files Browse the repository at this point in the history
Use h2
  • Loading branch information
RoyEJohnson authored Jan 6, 2025
1 parent 9734f3c commit 2f59433
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 42 deletions.
4 changes: 2 additions & 2 deletions src/components/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -243,13 +243,13 @@ const StepCard = ({
<StepCardHeader>
<div>
{leftHeaderChildren}
<div className="question-info" role="heading" aria-level={2}>
<h2 className="question-info">
{headerTitleChildren}
<span>{formattedQuestionNumber}</span>
{showTotalQuestions ? <span className="num-questions">&nbsp;/ {numberOfQuestions}</span> : null}
<span className="separator">|</span>
<span className="question-id">ID: {questionId}</span>
</div>
</h2>
</div>
{availablePoints || rightHeaderChildren ? <div>
{availablePoints && <div className="points">{availablePoints} Points</div>}
Expand Down
30 changes: 10 additions & 20 deletions src/components/__snapshots__/Card.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,8 @@ exports[`StepCard matches snapshot 1`] = `
className="sc-dkzDqf hbFgnH"
>
<div>
<div
aria-level={2}
<h2
className="question-info"
role="heading"
>
<span>
Question 1
Expand All @@ -29,7 +27,7 @@ exports[`StepCard matches snapshot 1`] = `
>
ID:
</span>
</div>
</h2>
</div>
<div>
<div
Expand Down Expand Up @@ -60,10 +58,8 @@ exports[`StepCard matches snapshot with more than one question 1`] = `
className="sc-dkzDqf hbFgnH"
>
<div>
<div
aria-level={2}
<h2
className="question-info"
role="heading"
>
<span>
Questions 1 - 3
Expand All @@ -84,7 +80,7 @@ exports[`StepCard matches snapshot with more than one question 1`] = `
>
ID:
</span>
</div>
</h2>
</div>
<div>
<div
Expand Down Expand Up @@ -116,10 +112,8 @@ exports[`TaskStepCard can optionally provide task 1`] = `
className="sc-dkzDqf hbFgnH"
>
<div>
<div
aria-level={2}
<h2
className="question-info"
role="heading"
>
<span>
Question 1
Expand All @@ -135,7 +129,7 @@ exports[`TaskStepCard can optionally provide task 1`] = `
ID:
1234@1
</span>
</div>
</h2>
</div>
</div>
<div
Expand All @@ -157,10 +151,8 @@ exports[`TaskStepCard can optionally provide type 1`] = `
className="sc-dkzDqf hbFgnH"
>
<div>
<div
aria-level={2}
<h2
className="question-info"
role="heading"
>
<span>
Question 1
Expand All @@ -176,7 +168,7 @@ exports[`TaskStepCard can optionally provide type 1`] = `
ID:
1234@1
</span>
</div>
</h2>
</div>
</div>
<div
Expand All @@ -198,10 +190,8 @@ exports[`TaskStepCard matches snapshot 1`] = `
className="sc-dkzDqf hbFgnH"
>
<div>
<div
aria-level={2}
<h2
className="question-info"
role="heading"
>
<span>
Question 1
Expand All @@ -217,7 +207,7 @@ exports[`TaskStepCard matches snapshot 1`] = `
ID:
1234@1
</span>
</div>
</h2>
</div>
</div>
<div
Expand Down
30 changes: 10 additions & 20 deletions src/components/__snapshots__/Exercise.spec.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ exports[`Exercise using step data matches snapshot 1`] = `
className="sc-dkzDqf hbFgnH"
>
<div>
<div
aria-level={2}
<h2
className="question-info"
role="heading"
>
<span>
Question 1
Expand All @@ -40,7 +38,7 @@ exports[`Exercise using step data matches snapshot 1`] = `
ID:
1234@4
</span>
</div>
</h2>
</div>
</div>
<div
Expand Down Expand Up @@ -208,10 +206,8 @@ exports[`Exercise with question state data matches snapshot 1`] = `
className="sc-dkzDqf hbFgnH"
>
<div>
<div
aria-level={2}
<h2
className="question-info"
role="heading"
>
<span>
Question 1
Expand All @@ -227,7 +223,7 @@ exports[`Exercise with question state data matches snapshot 1`] = `
ID:
1234@5
</span>
</div>
</h2>
</div>
</div>
<div
Expand Down Expand Up @@ -449,10 +445,8 @@ exports[`Exercise with question state data renders header icons with multiple ch
className="sc-dkzDqf hbFgnH"
>
<div>
<div
aria-level={2}
<h2
className="question-info"
role="heading"
>
<span>
Question 1
Expand All @@ -468,7 +462,7 @@ exports[`Exercise with question state data renders header icons with multiple ch
ID:
1234@5
</span>
</div>
</h2>
</div>
<div>
<div
Expand Down Expand Up @@ -776,10 +770,8 @@ exports[`Exercise with question state data renders header icons with two-step ex
className="sc-dkzDqf hbFgnH"
>
<div>
<div
aria-level={2}
<h2
className="question-info"
role="heading"
>
<span>
Question 1
Expand All @@ -795,7 +787,7 @@ exports[`Exercise with question state data renders header icons with two-step ex
ID:
1234@5
</span>
</div>
</h2>
</div>
<div>
<div
Expand Down Expand Up @@ -1089,10 +1081,8 @@ exports[`Exercise with question state data shows a detailed solution 1`] = `
className="sc-dkzDqf hbFgnH"
>
<div>
<div
aria-level={2}
<h2
className="question-info"
role="heading"
>
<span>
Question 1
Expand All @@ -1108,7 +1098,7 @@ exports[`Exercise with question state data shows a detailed solution 1`] = `
ID:
1234@5
</span>
</div>
</h2>
</div>
</div>
<div
Expand Down

0 comments on commit 2f59433

Please sign in to comment.