File tree 3 files changed +19
-2
lines changed
3 files changed +19
-2
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " apisearch" ,
3
- "version" : " 0.2.6 " ,
3
+ "version" : " 0.2.7 " ,
4
4
"description" : " Javascript client for Apisearch." ,
5
5
"main" : " lib/index.js" ,
6
6
"types" : " lib/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -1182,7 +1182,7 @@ export class Query {
1182
1182
for ( const i in this . itemsPromoted ) {
1183
1183
array
1184
1184
. items_promoted
1185
- . push ( this . itemsPromoted [ i ] . toArray ) ;
1185
+ . push ( this . itemsPromoted [ i ] . toArray ( ) ) ;
1186
1186
}
1187
1187
}
1188
1188
Original file line number Diff line number Diff line change @@ -330,6 +330,23 @@ describe('Query()', () => {
330
330
type : 'marvel'
331
331
} ) ;
332
332
} ) ;
333
+
334
+ it ( 'should work properly when doing toArray' , ( ) => {
335
+ // Promote thi two uuids into an existing array from the last test
336
+ query . promoteUUIDs (
337
+ new ItemUUID ( 'ironman' , 'marvel' ) ,
338
+ new ItemUUID ( 'thor' , 'marvel' )
339
+ ) ;
340
+ expect ( query . toArray ( ) . items_promoted . length ) . to . equal ( 2 ) ;
341
+ expect ( query . toArray ( ) . items_promoted [ 0 ] ) . to . deep . equal ( {
342
+ id : 'ironman' ,
343
+ type : 'marvel'
344
+ } ) ;
345
+ expect ( query . toArray ( ) . items_promoted [ 1 ] ) . to . deep . equal ( {
346
+ id : 'thor' ,
347
+ type : 'marvel'
348
+ } ) ;
349
+ } ) ;
333
350
} ) ;
334
351
335
352
describe ( '-> When excluding uuids' , ( ) => {
You can’t perform that action at this time.
0 commit comments