@@ -536,6 +536,48 @@ describe('render', () => {
536536 } ) ;
537537 } ) ;
538538
539+ test ( 'provides the scoped API' , ( ) => {
540+ const container = document . createElement ( 'div' ) ;
541+ const panelContainer = document . createElement ( 'div' ) ;
542+
543+ document . body . appendChild ( panelContainer ) ;
544+ autocomplete < { label : string } > ( {
545+ container,
546+ panelContainer,
547+ initialState : {
548+ isOpen : true ,
549+ } ,
550+ getSources ( ) {
551+ return [
552+ {
553+ sourceId : 'testSource' ,
554+ getItems ( ) {
555+ return [ { label : '1' } ] ;
556+ } ,
557+ templates : {
558+ item ( { item } ) {
559+ return item . label ;
560+ } ,
561+ } ,
562+ } ,
563+ ] ;
564+ } ,
565+ render ( params ) {
566+ expect ( params ) . toEqual (
567+ expect . objectContaining ( {
568+ refresh : expect . any ( Function ) ,
569+ setActiveItemId : expect . any ( Function ) ,
570+ setCollections : expect . any ( Function ) ,
571+ setContext : expect . any ( Function ) ,
572+ setIsOpen : expect . any ( Function ) ,
573+ setQuery : expect . any ( Function ) ,
574+ setStatus : expect . any ( Function ) ,
575+ } )
576+ ) ;
577+ } ,
578+ } ) ;
579+ } ) ;
580+
539581 test ( 'does not render the sections without results and noResults template on multi sources' , async ( ) => {
540582 const container = document . createElement ( 'div' ) ;
541583 const panelContainer = document . createElement ( 'div' ) ;
0 commit comments