Skip to content

Commit

Permalink
[10-10CG] - Change Facility VaSearchInput label (#33815)
Browse files Browse the repository at this point in the history
* change facility search input label to a p since the component already has one

* move required label to content.json for caregivers
  • Loading branch information
coope93 authored Dec 31, 2024
1 parent 75a20fa commit 9e7ff4c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -305,16 +305,20 @@ const FacilitySearch = props => {
searchInputError ? 'caregiver-facilities-search-input-error' : ''
}`}
>
<label
htmlFor="facility-search"
<p
className="vads-u-margin-top--0 vads-u-margin-bottom--1"
aria-hidden="true"
>
{content['form-facilities-search-label']}
<span className="vads-u-color--secondary-dark"> (*Required)</span>
</label>
{content['form-facilities-search-label']}{' '}
<span className="vads-u-color--secondary-dark">
{content['validation-required-label']}
</span>
</p>
{searchInputError && searchError()}
<VaSearchInput
label={content['form-facilities-search-label']}
label={`${content['form-facilities-search-label']} ${
content['validation-required-label']
}}`}
value={query}
onInput={handleChange}
onSubmit={handleSearch}
Expand Down
1 change: 1 addition & 0 deletions src/applications/caregivers/locales/en/content.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
"validation-facilities--search-required": "Enter a city, state or postal code",
"validation-facilities--submit-search-required": "Select the search button",
"validation-facilities--default-required": "Select a medical center or clinic",
"validation-required-label": "(*Required)",
"validation-signature-required": "Must certify by checking box",
"validation-sign-as-rep": "You must sign as representative.",
"validation-sign-as-rep--vet-name": "Your signature must match previously entered name: %s",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ describe('CG <FacilitySearch>', () => {
expect(selectors().moreFacilities).not.to.exist;
expect(selectors().ariaLiveStatus).not.to.exist;
expect(queryByText(content['form-facilities-search-label'])).to.exist;
expect(queryByText('(*Required)')).to.exist;
expect(queryByText(content['validation-required-label'])).to.exist;
});
});

Expand Down Expand Up @@ -699,7 +699,7 @@ describe('CG <FacilitySearch>', () => {
expect(selectors().searchInputError.parentElement).to.have.class(
'caregiver-facilities-search-input-error',
);
expect(getByText('(*Required)')).to.exist;
expect(getByText(content['validation-required-label'])).to.exist;
});

it('renders error when trying to click goForward when no search value is present', () => {
Expand All @@ -713,7 +713,7 @@ describe('CG <FacilitySearch>', () => {
expect(selectors().searchInputError.parentElement).to.have.class(
'caregiver-facilities-search-input-error',
);
expect(getByText('(*Required)')).to.exist;
expect(getByText(content['validation-required-label'])).to.exist;
});
});
});
Expand Down

0 comments on commit 9e7ff4c

Please sign in to comment.