Skip to content
This repository has been archived by the owner on Jan 9, 2023. It is now read-only.

Commit

Permalink
Merge pull request #264 from codyarose/codyarose_InputTestIds
Browse files Browse the repository at this point in the history
feat: add testids to inputs whose labels are not properly connected
  • Loading branch information
nobrayner authored Jan 11, 2021
2 parents e5e83e3 + e80383e commit c8c61a3
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const DatePickerWithLabelFormGroup = (props: Props) => {
} = props
const id = `${name}DatePicker`
return (
<div className="form-group">
<div className="form-group" data-testid={id}>
<Label text={label} htmlFor={id} isRequired={isRequired} />
<DateTimePicker
dateFormat="MM/dd/yyyy"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const DateTimePickerWithLabelFormGroup = (props: Props) => {
const { onChange, label, name, isEditable, value, isRequired, feedback, isInvalid } = props
const id = `${name}DateTimePicker`
return (
<div className="form-group">
<div className="form-group" data-testid={id}>
<Label text={label} isRequired={isRequired} htmlFor={id} />
<DateTimePicker
dateFormat="MM/dd/yyyy h:mm aa"
Expand Down
2 changes: 1 addition & 1 deletion src/shared/components/input/SelectWithLabelFormGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const SelectWithLabelFormGroup = (props: Props) => {
} = props
const id = `${name}Select`
return (
<div className="form-group">
<div className="form-group" data-testid={id}>
{label && <Label text={label} htmlFor={id} isRequired={isRequired} />}
<Select
id={id}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const TextFieldWithLabelFormGroup = (props: Props) => {
{label && <Label text={label} htmlFor={inputId} isRequired={isRequired} />}
<TextField
id={inputId}
data-testid={inputId}
rows={4}
value={value}
disabled={!isEditable}
Expand Down

0 comments on commit c8c61a3

Please sign in to comment.