import { initWidgets } from './widgets' ; jest . mock ( '@arcgis/core/widgets/LayerList' ) ; jest . mock ( '@arcgis/core/widgets/Legend' ) ; jest . mock ( '@arcgis/core/widgets/Search' ) ; describe ( 'widgets' , ( ) => { it ( 'initializes widgets in view' , ( ) => { const widgets = [ ] ; const view = { ui : { add ( w ) { widgets . push ( w ) ; } , } , } ; const layer = { } ; initWidgets ( { view , layer } ) ; expect ( widgets ) . toHaveLength ( 2 ) ; } ) ; } ) ;