Skip to content

Commit

Permalink
test corrections.
Browse files Browse the repository at this point in the history
  • Loading branch information
devinleighsmith committed Aug 27, 2024
1 parent e2ea042 commit 9449008
Show file tree
Hide file tree
Showing 5 changed files with 266 additions and 37 deletions.
6 changes: 3 additions & 3 deletions source/frontend/src/components/common/form/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,11 @@ export const Select: React.FC<React.PropsWithChildren<SelectProps>> = ({

const renderPlaceholder = () => {
const calculatedPlaceholder =
placeholder ?? options.find(option => option.value === value) ? null : 'N/A'; // Render N/A in the event that the currently selected value is not in the list.
if (!calculatedPlaceholder) {
!value || options.find(option => option.value === value) ? null : 'N/A'; // Render N/A in the event that the currently selected value is not in the list.
if (!calculatedPlaceholder && !placeholder) {
return null;
}
return <option value="">{`${calculatedPlaceholder}`}</option>;
return <option value="">{`${placeholder ?? calculatedPlaceholder}`}</option>;
};

const renderOptions = () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,11 @@ exports[`DocumentDetailForm component > renders as expected 1`] = `
id="input-documentStatusCode"
name="documentStatusCode"
>
<option
value=""
>
N/A
</option>
<option
class="option"
data-testid="select-option-NONE"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,11 @@ exports[`UpdatePropertyDetailsContainer component > renders as expected 1`] = `
id="input-regionTypeCode"
name="regionTypeCode"
>
<option
value=""
>
N/A
</option>
<option
class="option"
data-testid="select-option-1"
Expand Down Expand Up @@ -1416,6 +1421,11 @@ exports[`UpdatePropertyDetailsContainer component > renders as expected 1`] = `
id="input-pphStatusTypeCode"
name="pphStatusTypeCode"
>
<option
value=""
>
N/A
</option>
<option
class="option"
data-testid="select-option-ARTERY"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,11 @@ exports[`UpdatePropertyDetailsForm component > renders as expected 1`] = `
id="input-regionTypeCode"
name="regionTypeCode"
>
<option
value=""
>
N/A
</option>
<option
class="option"
data-testid="select-option-1"
Expand Down Expand Up @@ -1396,6 +1401,11 @@ exports[`UpdatePropertyDetailsForm component > renders as expected 1`] = `
id="input-pphStatusTypeCode"
name="pphStatusTypeCode"
>
<option
value=""
>
N/A
</option>
<option
class="option"
data-testid="select-option-ARTERY"
Expand Down
Loading

0 comments on commit 9449008

Please sign in to comment.