@@ -44,7 +44,7 @@ const dataset = [
4444 id : 1344 ,
4545 title : 'The Hobbit' ,
4646 comment : 'An awesome book' ,
47- genre : 'adventure ' ,
47+ genre : 'sci fi ' ,
4848 } ,
4949 {
5050 id : 4 ,
@@ -299,14 +299,26 @@ describe.each([
299299 } )
300300 . then ( ( response : Types . SearchResponse ) => {
301301 expect ( response ) . toHaveProperty ( 'facetsDistribution' , {
302- genre : { adventure : 0 , fantasy : 0 , romance : 2 } ,
302+ genre : { adventure : 0 , fantasy : 0 , romance : 2 , "sci fi" : 0 , } ,
303303 } )
304304 expect ( response ) . toHaveProperty ( 'exhaustiveFacetsCount' , true )
305305 expect ( response ) . toHaveProperty ( 'hits' , expect . any ( Array ) )
306306 expect ( response . hits . length ) . toEqual ( 2 )
307307 } )
308308 } )
309309
310+ test ( `${ permission } key: Search with facetFilters with spaces` , async ( ) => {
311+ await client
312+ . getIndex ( index . uid )
313+ . search ( 'h' , {
314+ facetFilters : [ 'genre:sci fi' ] ,
315+ } )
316+ . then ( ( response : Types . SearchResponse ) => {
317+ expect ( response ) . toHaveProperty ( 'hits' , expect . any ( Array ) )
318+ expect ( response . hits . length ) . toEqual ( 1 )
319+ } )
320+ } )
321+
310322 test ( `${ permission } key: Search with multiple facetFilters` , async ( ) => {
311323 await client
312324 . getIndex ( index . uid )
@@ -316,7 +328,7 @@ describe.each([
316328 } )
317329 . then ( ( response : Types . SearchResponse ) => {
318330 expect ( response ) . toHaveProperty ( 'facetsDistribution' , {
319- genre : { adventure : 0 , fantasy : 0 , romance : 2 } ,
331+ genre : { adventure : 0 , fantasy : 0 , romance : 2 , "sci fi" : 0 , } ,
320332 } )
321333 expect ( response ) . toHaveProperty ( 'exhaustiveFacetsCount' , true )
322334 expect ( response ) . toHaveProperty ( 'hits' , expect . any ( Array ) )
0 commit comments