File tree Expand file tree Collapse file tree 1 file changed +1
-16
lines changed
src/plugins/es_ui_shared/static/forms/hook_form_lib/components Expand file tree Collapse file tree 1 file changed +1
-16
lines changed Original file line number Diff line number Diff line change @@ -289,30 +289,16 @@ describe('<UseField />', () => {
289289 } ) ;
290290
291291 describe ( 'change handlers' , ( ) => {
292- interface MyForm {
293- name : string ;
294- }
295-
296292 const onError = jest . fn ( ) ;
297- let formHook : FormHook < MyForm > | null = null ;
298293
299294 beforeEach ( ( ) => {
300295 jest . resetAllMocks ( ) ;
301- formHook = null ;
302296 } ) ;
303297
304- const onFormHook = ( _form : FormHook < MyForm > ) => {
305- formHook = _form ;
306- } ;
307-
308298 const getTestComp = ( fieldConfig : FieldConfig ) => {
309- const TestComp = ( { onForm } : { onForm : ( form : FormHook ) => void } ) => {
299+ const TestComp = ( ) => {
310300 const { form } = useForm < any > ( ) ;
311301
312- useEffect ( ( ) => {
313- onForm ( form ) ;
314- } , [ onForm , form ] ) ;
315-
316302 return (
317303 < Form form = { form } >
318304 < UseField path = "name" config = { fieldConfig } data-test-subj = "myField" onError = { onError } />
@@ -325,7 +311,6 @@ describe('<UseField />', () => {
325311 const setup = ( fieldConfig : FieldConfig ) => {
326312 return registerTestBed ( getTestComp ( fieldConfig ) , {
327313 memoryRouter : { wrapComponent : false } ,
328- defaultProps : { onForm : onFormHook } ,
329314 } ) ( ) as TestBed ;
330315 } ;
331316
You can’t perform that action at this time.
0 commit comments