Skip to content

Commit

Permalink
Merge pull request #957 from GSA/956-fix-error-hidden
Browse files Browse the repository at this point in the history
fix error hidden
  • Loading branch information
scottqueen-bixal authored Mar 1, 2024
2 parents eebf926 + d2cd370 commit f4bfd4b
Show file tree
Hide file tree
Showing 8 changed files with 108 additions and 2 deletions.
65 changes: 65 additions & 0 deletions benefit-finder/src/App/__tests__/__snapshots__/index.spec.jsx.snap

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
exports[`Alert > renders a match to the previous snapshot 1`] = `
<DocumentFragment>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info "
role="alert"
Expand Down
5 changes: 3 additions & 2 deletions benefit-finder/src/shared/components/Alert/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const Alert = ({
heading,
description,
error,
hasError,
noBackground,
tabIndex,
}) => {
Expand All @@ -46,8 +47,8 @@ const Alert = ({
role="alert"
ref={alertFieldRef}
tabIndex={tabIndex || 0}
aria-live="polite"
aria-hidden={error}
aria-live={hasError === true ? 'assertive' : 'polite'}
aria-hidden={!hasError}
>
{children ? (
<div className="bf-usa-alert__body usa-alert__body">
Expand Down
1 change: 1 addition & 0 deletions benefit-finder/src/shared/components/Date/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const Date = ({ onChange, value, required, ui, id, invalid }) => {
heading={ui.alertBanner.heading}
description={alert}
error
hasError={invalid}
></Alert>
)}
<div className="bf-usa-form-group usa-form-group bf-usa-form-group--month usa-form-group--month bf-usa-form-group--select usa-form-group--select">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ exports[`Intro > renders a match to the previous snapshot 1`] = `
class="bf-notice"
>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info no-background"
role="alert"
Expand Down Expand Up @@ -145,6 +146,7 @@ exports[`Intro > renders a match to the previous snapshot 1`] = `
class="bf-notice"
>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info no-background"
role="alert"
Expand Down Expand Up @@ -173,6 +175,7 @@ exports[`Intro > renders a match to the previous snapshot 1`] = `
class="bf-notice"
>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info no-background"
role="alert"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ const LifeEventSection = ({
heading={ui.alertBanner.heading}
description={ui.alertBanner.description}
error
hasError={hasError.length > 0}
></Alert>
<Heading className="bf-usa-section-heading" headingLevel={2}>
{currentData.section.heading}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ exports[`NoticesList > renders a match to the previous snapshot 1`] = `
class="bf-notice"
>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info no-background"
role="alert"
Expand Down Expand Up @@ -41,6 +42,7 @@ exports[`NoticesList > renders a match to the previous snapshot 1`] = `
class="bf-notice"
>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info no-background"
role="alert"
Expand Down Expand Up @@ -69,6 +71,7 @@ exports[`NoticesList > renders a match to the previous snapshot 1`] = `
class="bf-notice"
>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info no-background"
role="alert"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,7 @@ exports[`scenario 1 loads in view with the correct amount of likely eligible ite
</ul>
</div>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info "
role="alert"
Expand Down Expand Up @@ -641,6 +642,7 @@ exports[`scenario 1 loads in view with the correct amount of likely eligible ite
</ul>
</div>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info "
role="alert"
Expand Down Expand Up @@ -851,6 +853,7 @@ exports[`scenario 1 loads in view with the correct amount of likely eligible ite
</ul>
</div>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info "
role="alert"
Expand Down Expand Up @@ -1066,6 +1069,7 @@ exports[`scenario 1 loads in view with the correct amount of likely eligible ite
</ul>
</div>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info "
role="alert"
Expand Down Expand Up @@ -1252,6 +1256,7 @@ exports[`scenario 1 loads in view with the correct amount of likely eligible ite
</ul>
</div>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info "
role="alert"
Expand Down Expand Up @@ -1452,6 +1457,7 @@ exports[`scenario 1 loads in view with the correct amount of likely eligible ite
</ul>
</div>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info "
role="alert"
Expand Down Expand Up @@ -1741,6 +1747,7 @@ exports[`scenario 1 loads in view with the correct amount of likely eligible ite
</ul>
</div>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info "
role="alert"
Expand Down Expand Up @@ -1942,6 +1949,7 @@ exports[`scenario 1 loads in view with the correct amount of likely eligible ite
</ul>
</div>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info "
role="alert"
Expand Down Expand Up @@ -2138,6 +2146,7 @@ exports[`scenario 1 loads in view with the correct amount of likely eligible ite
</ul>
</div>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info "
role="alert"
Expand Down Expand Up @@ -2382,6 +2391,7 @@ exports[`scenario 1 loads in view with the correct amount of likely eligible ite
</ul>
</div>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info "
role="alert"
Expand Down Expand Up @@ -2602,6 +2612,7 @@ exports[`scenario 1 loads in view with the correct amount of likely eligible ite
</ul>
</div>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info "
role="alert"
Expand Down Expand Up @@ -2782,6 +2793,7 @@ exports[`scenario 1 loads in view with the correct amount of likely eligible ite
</ul>
</div>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info "
role="alert"
Expand Down Expand Up @@ -3027,6 +3039,7 @@ exports[`scenario 1 loads in view with the correct amount of likely eligible ite
</ul>
</div>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info "
role="alert"
Expand Down Expand Up @@ -3237,6 +3250,7 @@ exports[`scenario 1 loads in view with the correct amount of likely eligible ite
</ul>
</div>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info "
role="alert"
Expand Down Expand Up @@ -3497,6 +3511,7 @@ exports[`scenario 1 loads in view with the correct amount of likely eligible ite
</ul>
</div>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info "
role="alert"
Expand Down Expand Up @@ -3712,6 +3727,7 @@ exports[`scenario 1 loads in view with the correct amount of likely eligible ite
</ul>
</div>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info "
role="alert"
Expand Down Expand Up @@ -3905,6 +3921,7 @@ exports[`scenario 1 loads in view with the correct amount of likely eligible ite
</ul>
</div>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info "
role="alert"
Expand Down Expand Up @@ -4097,6 +4114,7 @@ exports[`scenario 1 loads in view with the correct amount of likely eligible ite
</ul>
</div>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info "
role="alert"
Expand Down Expand Up @@ -4312,6 +4330,7 @@ exports[`scenario 1 loads in view with the correct amount of likely eligible ite
</ul>
</div>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info "
role="alert"
Expand Down Expand Up @@ -4543,6 +4562,7 @@ exports[`scenario 1 loads in view with the correct amount of likely eligible ite
</ul>
</div>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info "
role="alert"
Expand Down Expand Up @@ -4797,6 +4817,7 @@ exports[`scenario 1 loads in view with the correct amount of likely eligible ite
</ul>
</div>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info "
role="alert"
Expand Down Expand Up @@ -5057,6 +5078,7 @@ exports[`scenario 1 loads in view with the correct amount of likely eligible ite
</ul>
</div>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info "
role="alert"
Expand Down Expand Up @@ -5308,6 +5330,7 @@ exports[`scenario 1 loads in view with the correct amount of likely eligible ite
</ul>
</div>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info "
role="alert"
Expand Down Expand Up @@ -5597,6 +5620,7 @@ exports[`scenario 1 loads in view with the correct amount of likely eligible ite
</ul>
</div>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info "
role="alert"
Expand Down Expand Up @@ -5910,6 +5934,7 @@ exports[`scenario 1 loads in view with the correct amount of likely eligible ite
</ul>
</div>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info "
role="alert"
Expand Down Expand Up @@ -6105,6 +6130,7 @@ exports[`scenario 1 loads in view with the correct amount of likely eligible ite
</ul>
</div>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info "
role="alert"
Expand Down Expand Up @@ -6330,6 +6356,7 @@ exports[`scenario 1 loads in view with the correct amount of likely eligible ite
</ul>
</div>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info "
role="alert"
Expand Down Expand Up @@ -6574,6 +6601,7 @@ exports[`scenario 1 loads in view with the correct amount of likely eligible ite
</ul>
</div>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info "
role="alert"
Expand Down Expand Up @@ -6848,6 +6876,7 @@ exports[`scenario 1 loads in view with the correct amount of likely eligible ite
</ul>
</div>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info "
role="alert"
Expand Down Expand Up @@ -7063,6 +7092,7 @@ exports[`scenario 1 loads in view with the correct amount of likely eligible ite
</ul>
</div>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info "
role="alert"
Expand Down Expand Up @@ -7278,6 +7308,7 @@ exports[`scenario 1 loads in view with the correct amount of likely eligible ite
</ul>
</div>
<div
aria-hidden="true"
aria-live="polite"
class="bf-usa-alert bf-usa-alert usa-alert bf-usa-alert--info usa-alert--info "
role="alert"
Expand Down

0 comments on commit f4bfd4b

Please sign in to comment.