File tree Expand file tree Collapse file tree 5 files changed +2779
-3326
lines changed
Expand file tree Collapse file tree 5 files changed +2779
-3326
lines changed Original file line number Diff line number Diff line change 5555 "@testing-library/react" : " 12.1.5" ,
5656 "@testing-library/user-event" : " ^14.4.3" ,
5757 "@types/jest" : " ^29.2.2" ,
58- "@types/react" : " ^17.0.3 " ,
59- "@types/react-dom" : " ^17.0.2 " ,
58+ "@types/react" : " ^16.14.43 " ,
59+ "@types/react-dom" : " ^16.9.19 " ,
6060 "auto-changelog" : " ^2.4.0" ,
6161 "husky" : " ^4.2.5" ,
6262 "jest" : " ^29.3.0" ,
6767 "ts-jest" : " ^29.0.3" ,
6868 "tsdx" : " ^0.14.1" ,
6969 "tslib" : " ^2.4.1" ,
70- "typescript" : " ^4.8.4 "
70+ "typescript" : " ^5.1.6 "
7171 },
7272 "peerDependencies" : {
7373 "react" : " >=16 || >=17"
7474 },
75+ "resolutions" : {
76+ "@types/react" : " 17" ,
77+ "@types/react-dom" : " 17"
78+ },
7579 "husky" : {
7680 "hooks" : {
7781 "pre-commit" : " tsdx lint"
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ class FormsyDropdown extends Component<IFormsyDropdownProps> {
7575 } ;
7676
7777 handleBlur = (
78- e : React . KeyboardEvent < HTMLElement > ,
78+ e : React . FocusEvent < HTMLElement > ,
7979 data : StrictDropdownProps
8080 ) => {
8181 const { onBlur } = this . props ;
Original file line number Diff line number Diff line change @@ -162,9 +162,9 @@ describe('<Form/>', () => {
162162 // eslint-disable-line
163163 return (
164164 < Form
165- onValidSubmit = { onValidSubmit }
166- onInvalidSubmit = { onInvalidSubmit }
167- onSubmit = { onSubmit }
165+ onValidSubmit = { ( model ) => onValidSubmit ( model ) }
166+ onInvalidSubmit = { ( model ) => onInvalidSubmit ( model ) }
167+ onSubmit = { ( model ) => onSubmit ( model ) }
168168 onValid = { ( ) => ( isValid = true ) }
169169 onInvalid = { ( ) => ( isValid = false ) }
170170 >
@@ -191,11 +191,7 @@ describe('<Form/>', () => {
191191 } ;
192192
193193 const validateSubmitCall = ( formData : any ) => {
194- expect ( onSubmit ) . toHaveBeenCalledWith (
195- formData ,
196- expect . any ( Function ) ,
197- expect . any ( Function )
198- ) ;
194+ expect ( onSubmit ) . toHaveBeenCalledWith ( formData ) ;
199195 } ;
200196
201197 beforeEach ( ( ) => {
Original file line number Diff line number Diff line change @@ -31,7 +31,9 @@ describe('<Checkbox/>', () => {
3131
3232 beforeEach ( ( ) => {
3333 onSubmitSpy = jest . fn ( ) ;
34- wrapper = render ( < TestForm onSubmit = { onSubmitSpy } /> ) ;
34+ wrapper = render (
35+ < TestForm onSubmit = { ( model : any ) => onSubmitSpy ( model ) } />
36+ ) ;
3537 checkbox = wrapper . getByRole ( 'checkbox' ) ;
3638 } ) ;
3739
@@ -59,26 +61,21 @@ describe('<Checkbox/>', () => {
5961 it ( 'should set a boolean value on checkbox without value / defaultChecked' , ( ) => {
6062 submitForm ( ) ;
6163
62- expect ( onSubmitSpy ) . toHaveBeenCalledWith (
63- { testInput : false } ,
64- expect . any ( Function ) ,
65- expect . any ( Function )
66- ) ;
64+ expect ( onSubmitSpy ) . toHaveBeenCalledWith ( { testInput : false } ) ;
6765 } ) ;
6866
6967 it ( 'should use defaultChecked as initial value' , ( ) => {
7068 const spy = jest . fn ( ) ;
7169 const defaultChecked = true ;
7270 wrapper = render (
73- < TestForm defaultChecked = { defaultChecked } onSubmit = { spy } />
71+ < TestForm
72+ defaultChecked = { defaultChecked }
73+ onSubmit = { ( model : any ) => spy ( model ) }
74+ />
7475 ) ;
7576 submitForm ( ) ;
7677
77- expect ( spy ) . toHaveBeenCalledWith (
78- { testInput : defaultChecked } ,
79- expect . any ( Function ) ,
80- expect . any ( Function )
81- ) ;
78+ expect ( spy ) . toHaveBeenCalledWith ( { testInput : defaultChecked } ) ;
8279 } ) ;
8380
8481 describe ( 'When value is invalid' , ( ) => {
You can’t perform that action at this time.
0 commit comments