import { registerTestBed } from '@kbn/test/jest' ; import { searchResponse } from './fixtures/search_response' ; import { ProfileTree , Props } from '../profile_tree' ; describe ( 'ProfileTree' , ( ) => { it ( 'renders' , async ( ) => { const props = { onHighlight : ( ) => { } , target : 'searches' , data : searchResponse , onDataInitError : jest . fn ( ) , } ; const init = registerTestBed ( ProfileTree ) ; await init ( props ) ; } ) ; it ( 'does not throw despite bad profile data' , async ( ) => { const props = { onHighlight : ( ) => { } , target : 'searches' , onDataInitError : jest . fn ( ) , data : [ { } ] as any , } ; const init = registerTestBed ( ProfileTree ) ; await init ( props ) ; expect ( props . onDataInitError ) . toHaveBeenCalled ( ) ; } ) ; } ) ;