File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed
src/connectors/voice-search Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,18 @@ See documentation: https://www.algolia.com/doc/api-reference/widgets/voice-searc
113113 expect ( helper . search ) . toHaveBeenCalledTimes ( 1 ) ;
114114 } ) ;
115115
116+ describe ( 'getConfiguration' , ( ) => {
117+ it ( 'adds a `query` to the `SearchParameters`' , ( ) => {
118+ const renderFn = ( ) => { } ;
119+ const makeWidget = connectVoiceSearch ( renderFn ) ;
120+ const widget = makeWidget ( { } ) ;
121+
122+ const nextConfiguration = widget . getConfiguration ( ) ;
123+
124+ expect ( nextConfiguration . query ) . toBe ( '' ) ;
125+ } ) ;
126+ } ) ;
127+
116128 describe ( 'dispose' , ( ) => {
117129 it ( 'calls the unmount function' , ( ) => {
118130 const helper = algoliasearchHelper ( { } , '' ) ;
Original file line number Diff line number Diff line change @@ -74,6 +74,12 @@ const connectVoiceSearch: VoiceSearchConnector = (
7474 const { searchAsYouSpeak = false } = widgetParams ;
7575
7676 return {
77+ getConfiguration ( ) {
78+ return {
79+ query : '' ,
80+ } ;
81+ } ,
82+
7783 init ( { helper, instantSearchInstance } ) {
7884 ( this as any ) . _refine = ( query : string ) : void => {
7985 if ( query !== helper . state . query ) {
You can’t perform that action at this time.
0 commit comments