File tree Expand file tree Collapse file tree 1 file changed +37
-1
lines changed
packages/recommend/src/__tests__ Expand file tree Collapse file tree 1 file changed +37
-1
lines changed Original file line number Diff line number Diff line change @@ -126,7 +126,7 @@ describe('getRecommendations', () => {
126
126
) ;
127
127
} ) ;
128
128
129
- test ( 'override `undefined` threshold with default value' , async ( ) => {
129
+ test ( 'overrides `undefined` threshold with default value' , async ( ) => {
130
130
const client = createMockedClient ( ) ;
131
131
132
132
await client . getRecommendations (
@@ -161,4 +161,40 @@ describe('getRecommendations', () => {
161
161
{ }
162
162
) ;
163
163
} ) ;
164
+
165
+ test ( 'overrides default threshold value' , async ( ) => {
166
+ const client = createMockedClient ( ) ;
167
+
168
+ await client . getRecommendations (
169
+ [
170
+ {
171
+ model : 'bought-together' ,
172
+ indexName : 'products' ,
173
+ objectID : 'B018APC4LE' ,
174
+ threshold : 42 ,
175
+ } ,
176
+ ] ,
177
+ { }
178
+ ) ;
179
+
180
+ expect ( client . transporter . read ) . toHaveBeenCalledTimes ( 1 ) ;
181
+ expect ( client . transporter . read ) . toHaveBeenCalledWith (
182
+ {
183
+ cacheable : true ,
184
+ data : {
185
+ requests : [
186
+ {
187
+ indexName : 'products' ,
188
+ model : 'bought-together' ,
189
+ objectID : 'B018APC4LE' ,
190
+ threshold : 42 ,
191
+ } ,
192
+ ] ,
193
+ } ,
194
+ method : 'POST' ,
195
+ path : '1/indexes/*/recommendations' ,
196
+ } ,
197
+ { }
198
+ ) ;
199
+ } ) ;
164
200
} ) ;
You can’t perform that action at this time.
0 commit comments