import { createSelectHandler , HandleChange } from './create_select_handler' ; describe ( 'createSelectHandler' , ( ) => { describe ( 'createSelectHandler()' , ( ) => { let handleChange ; let changeHandler ; beforeEach ( ( ) => { handleChange = jest . fn ( ) ; changeHandler = createSelectHandler ( handleChange ) ; } ) ; test ( 'should calls handleChange() function with the correct data' , ( ) => { const fn = changeHandler ( 'test' ) ; fn ( [ { value : 'foo' , label : 'foo' } ] ) ; expect ( handleChange ) . toHaveBeenCalledWith ( { test : 'foo' , } ) ; } ) ; } ) ; } ) ;