11import  AbortController  from  'abort-controller' 
2- import  {  ErrorStatusCode ,  EnqueuedTask  }  from  '../src/types' 
2+ import  {  ErrorStatusCode ,  EnqueuedTask ,   MatchingStrategies  }  from  '../src/types' 
33import  { 
44  clearAllIndexes , 
55  config , 
@@ -95,6 +95,32 @@ describe.each([
9595    expect ( response . hits . length ) . toEqual ( 2 ) 
9696  } ) 
9797
98+   test ( `${ permission }   key: Basic phrase search with matchingStrategy at ALL` ,  async  ( )  =>  { 
99+     const  client  =  await  getClient ( permission ) 
100+     const  response  =  await  client 
101+       . index ( index . uid ) 
102+       . search ( '"french book" about' ,  { 
103+         matchingStrategy : MatchingStrategies . ALL , 
104+       } ) 
105+ 
106+     expect ( response ) . toHaveProperty ( 'hits' ,  expect . any ( Array ) ) 
107+     expect ( response ) . toHaveProperty ( 'offset' ,  0 ) 
108+     expect ( response ) . toHaveProperty ( 'limit' ,  20 ) 
109+     expect ( response . hits . length ) . toEqual ( 1 ) 
110+   } ) 
111+ 
112+   test ( `${ permission }   key: Basic phrase search with matchingStrategy at LAST` ,  async  ( )  =>  { 
113+     const  client  =  await  getClient ( permission ) 
114+     const  response  =  await  client 
115+       . index ( index . uid ) 
116+       . search ( 'french book' ,  {  matchingStrategy : MatchingStrategies . LAST  } ) 
117+ 
118+     expect ( response ) . toHaveProperty ( 'hits' ,  expect . any ( Array ) ) 
119+     expect ( response ) . toHaveProperty ( 'offset' ,  0 ) 
120+     expect ( response ) . toHaveProperty ( 'limit' ,  20 ) 
121+     expect ( response . hits . length ) . toEqual ( 2 ) 
122+   } ) 
123+ 
98124  test ( `${ permission }   key: Search with query in searchParams overwriting query` ,  async  ( )  =>  { 
99125    const  client  =  await  getClient ( permission ) 
100126    const  response  =  await  client 
@@ -121,7 +147,8 @@ describe.each([
121147    expect ( response . hits . length ) . toEqual ( 2 ) 
122148  } ) 
123149
124-   test ( `${ permission }   key: Basic phrase search` ,  async  ( )  =>  { 
150+   // TODO: remove skip when bug is fixed by core 
151+   test . skip ( `${ permission }   key: Basic phrase search` ,  async  ( )  =>  { 
125152    const  client  =  await  getClient ( permission ) 
126153    const  response  =  await  client 
127154      . index ( index . uid ) 
@@ -131,6 +158,7 @@ describe.each([
131158    expect ( response ) . toHaveProperty ( 'limit' ,  20 ) 
132159    expect ( response ) . toHaveProperty ( 'processingTimeMs' ,  expect . any ( Number ) ) 
133160    expect ( response ) . toHaveProperty ( 'query' ,  '"french book" about' ) 
161+ 
134162    expect ( response . hits . length ) . toEqual ( 2 ) 
135163  } ) 
136164
0 commit comments