From b1a845690605cf607dd0769dd48f7fc3ab9febcc Mon Sep 17 00:00:00 2001 From: Sonia Connolly Date: Tue, 10 Jan 2023 13:20:08 -0800 Subject: [PATCH] Add screenreader tag for incomplete steps, and fix test Co-authored-by: Eric Gade changelog: User-Facing Improvements, Accessibility, Step indicator screen reader tags --- .../packages/step-indicator/step-indicator-step.spec.tsx | 2 +- .../packages/step-indicator/step-indicator-step.tsx | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/app/javascript/packages/step-indicator/step-indicator-step.spec.tsx b/app/javascript/packages/step-indicator/step-indicator-step.spec.tsx index 10838a751fa..fcfce8a5151 100644 --- a/app/javascript/packages/step-indicator/step-indicator-step.spec.tsx +++ b/app/javascript/packages/step-indicator/step-indicator-step.spec.tsx @@ -43,7 +43,7 @@ describe('StepIndicatorStep', () => { ); const title = getByText('Step'); - const status = getByText('step_indicator.status.current'); + const status = getByText('step_indicator.status.not_complete'); const step = title.closest('.step-indicator__step')!; expect(title).to.be.ok(); diff --git a/app/javascript/packages/step-indicator/step-indicator-step.tsx b/app/javascript/packages/step-indicator/step-indicator-step.tsx index 95d93add49b..eee02e09fbf 100644 --- a/app/javascript/packages/step-indicator/step-indicator-step.tsx +++ b/app/javascript/packages/step-indicator/step-indicator-step.tsx @@ -20,7 +20,7 @@ export interface StepIndicatorStepProps { } function StepIndicatorStep({ title, status }: StepIndicatorStepProps) { - const { CURRENT, COMPLETE, PENDING } = StepStatus; + const { CURRENT, COMPLETE, PENDING, INCOMPLETE } = StepStatus; const classes = [ 'step-indicator__step', @@ -35,6 +35,9 @@ function StepIndicatorStep({ title, status }: StepIndicatorStepProps) { case COMPLETE: statusText = t('step_indicator.status.complete'); break; + case INCOMPLETE: + statusText = t('step_indicator.status.not_complete'); + break; case PENDING: statusText = t('step_indicator.status.pending'); break;