File tree Expand file tree Collapse file tree 3 files changed +4
-6
lines changed
Expand file tree Collapse file tree 3 files changed +4
-6
lines changed Original file line number Diff line number Diff line change 1- import React , { HTMLProps } from 'react' ;
1+ import React , { HTMLProps , MutableRefObject } from 'react' ;
22import classNames from 'classnames' ;
33import FormGroup from '../../util/FormGroup' ;
44import { InputWidth } from '../../util/types/NHSUKTypes' ;
55import { FormElementProps } from '../../util/types/FormTypes' ;
66
77interface InputProps extends HTMLProps < HTMLInputElement > , FormElementProps {
8- inputRef ?: ( inputRef : HTMLInputElement | null ) => any ;
8+ inputRef ?: MutableRefObject < HTMLInputElement | null > ;
99 width ?: InputWidth ;
1010 disableErrorLine ?: boolean ;
1111}
Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ describe('Input', () => {
1919 it ( 'should do nothing if ref does not exist' , ( ) => {
2020 const useRefSpy = jest . spyOn ( React , 'useRef' ) . mockReturnValueOnce ( { current : null } ) ;
2121 const component = shallow ( < InputComp /> ) ;
22- console . log ( component . debug ( ) ) ;
2322 component . find ( 'Input' ) . simulate ( 'click' ) ;
2423 expect ( useRefSpy ) . toBeCalledWith ( null ) ;
2524 } ) ;
@@ -32,4 +31,4 @@ describe('Input', () => {
3231 expect ( useRefSpy ) . toBeCalledWith ( null ) ;
3332 expect ( mock ) . toBeCalledTimes ( 1 ) ;
3433 } ) ;
35- } )
34+ } )
Original file line number Diff line number Diff line change @@ -20,8 +20,7 @@ describe(`Select`, () => {
2020 it ( `should do nothing if ref does not exist` , ( ) => {
2121 const useRefSpy = jest . spyOn ( React , 'useRef' ) . mockReturnValueOnce ( { current : null } ) ;
2222 const component = shallow ( < SelectComp /> ) ;
23- console . log ( component . debug ( ) ) ;
2423 component . find ( 'Select' ) . simulate ( 'click' ) ;
2524 expect ( useRefSpy ) . toBeCalledWith ( null ) ;
2625 } ) ;
27- } )
26+ } )
You can’t perform that action at this time.
0 commit comments