Skip to content

Commit

Permalink
Merge branch 'develop' into ee-review-prototype
Browse files Browse the repository at this point in the history
  • Loading branch information
KhalidAdan authored and Khalid committed Jan 25, 2022
2 parents aa78728 + 81eb62c commit adb171b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions __tests__/components/TextField.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ describe('TextField component', () => {

const field = screen.getByTestId('text-input')
expect(field).toBeInTheDocument()
expect(field.tagName).toBe('TEXTAREA')
expect(field.tagName).toBe('INPUT')
expect(field).toBeDefined()
expect(field).toBeRequired()
})
Expand Down Expand Up @@ -69,7 +69,7 @@ describe('TextField component', () => {

const field = screen.getByTestId('text-input')
expect(field).toBeInTheDocument()
expect(field.tagName).toBe('TEXTAREA')
expect(field.tagName).toBe('INPUT')
expect(field).toBeDefined()
expect(field).toBeRequired()

Expand Down
2 changes: 1 addition & 1 deletion client-state/models/FormField.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,6 @@ export const FormField = types
handleChange: flow(function* (e) {
const inputVal = e?.target?.value ?? { key: e.value, text: e.label }
self.setValue(inputVal)
yield (getParent(self, 2) as Instance<typeof Form>).sendAPIRequest()
yield (getParent(self, 2) as Instance<typeof Form>).sendAPIRequest() // the form field is 2 children from the form e.g. Form -> fields Object -> current form field instance
}),
}))
2 changes: 1 addition & 1 deletion components/Forms/NumberField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export const NumberField: React.VFC<NumberFieldProps> = observer((props) => {
id={name}
name={name}
className={`form-control text-content ${error ? ' border-danger' : ''}`}
data-testid={name}
data-testid="number-input"
min={0}
value={value != null ? (value as string) : ''}
placeholder={placeholder}
Expand Down
1 change: 1 addition & 0 deletions components/Forms/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export const TextField: React.VFC<TextFieldProps> = observer((props) => {
{error && <ErrorLabel errorMessage={error} />}
<input
type="text"
data-testid="text-input"
className={`form-control text-content ${error ? ' border-danger' : ''}`}
placeholder={placeholder}
onChange={onChange}
Expand Down

0 comments on commit adb171b

Please sign in to comment.