File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -270,6 +270,41 @@ describe('matchesQuery', function () {
270
270
expect ( matchesQuery ( obj1 , q ) ) . toBe ( true ) ;
271
271
} ) ;
272
272
273
+ it ( 'matches on queries with new format #parse-SDK-JS/pull/1373 for Pointer' , function ( ) {
274
+ const obj1 = {
275
+ objectId : 'Person01' ,
276
+ name : 'Bill' ,
277
+ age : 34 ,
278
+ } ;
279
+
280
+ const obj2 = {
281
+ objectId : 'Car01' ,
282
+ name : 'Volkswagen' ,
283
+ owner : pointer ( 'Person' , obj1 . objectId ) ,
284
+ } ;
285
+
286
+ const q = {
287
+ owner : {
288
+ $eq : pointer ( 'Person' , obj1 . objectId ) ,
289
+ } ,
290
+ } ;
291
+ expect ( matchesQuery ( obj2 , q ) ) . toBe ( true ) ;
292
+ } ) ;
293
+
294
+ it ( 'matches on queries with new format #parse-SDK-JS/pull/1373 for Object' , function ( ) {
295
+ const obj1 = {
296
+ id : new Id ( 'Person' , '01' ) ,
297
+ addr : { planet : 'Earth' } ,
298
+ } ;
299
+
300
+ const q = {
301
+ addr : {
302
+ $eq : { planet : 'Earth' } ,
303
+ } ,
304
+ } ;
305
+ expect ( matchesQuery ( obj1 , q ) ) . toBe ( true ) ;
306
+ } ) ;
307
+
273
308
it ( 'matches on inequalities' , function ( ) {
274
309
const player = {
275
310
id : new Id ( 'Person' , 'O1' ) ,
You can’t perform that action at this time.
0 commit comments