@@ -360,7 +360,16 @@ describe('matchesQuery', function() {
360
360
id : new Id ( 'Checkin' , 'C1' ) ,
361
361
location : new Parse . GeoPoint ( 40 , 40 )
362
362
} ;
363
+ var ptUndefined = {
364
+ id : new Id ( 'Checkin' , 'C1' )
365
+ } ;
366
+ var ptNull = {
367
+ id : new Id ( 'Checkin' , 'C1' ) ,
368
+ location : null
369
+ } ;
363
370
expect ( matchesQuery ( pt , q ) ) . toBe ( true ) ;
371
+ expect ( matchesQuery ( ptUndefined , q ) ) . toBe ( false ) ;
372
+ expect ( matchesQuery ( ptNull , q ) ) . toBe ( false ) ;
364
373
365
374
q = new Parse . Query ( 'Checkin' ) ;
366
375
pt . location = new Parse . GeoPoint ( 40 , 40 ) ;
@@ -384,6 +393,17 @@ describe('matchesQuery', function() {
384
393
name : 'Santa Clara'
385
394
} ;
386
395
396
+ var noLocation = {
397
+ id : new Id ( 'Checkin' , 'C2' ) ,
398
+ name : 'Santa Clara'
399
+ } ;
400
+
401
+ var nullLocation = {
402
+ id : new Id ( 'Checkin' , 'C2' ) ,
403
+ location : null ,
404
+ name : 'Santa Clara'
405
+ } ;
406
+
387
407
var q = new Parse . Query ( 'Checkin' ) . withinGeoBox (
388
408
'location' ,
389
409
new Parse . GeoPoint ( 37.708813 , - 122.526398 ) ,
@@ -392,7 +412,8 @@ describe('matchesQuery', function() {
392
412
393
413
expect ( matchesQuery ( caltrainStation , q ) ) . toBe ( true ) ;
394
414
expect ( matchesQuery ( santaClara , q ) ) . toBe ( false ) ;
395
-
415
+ expect ( matchesQuery ( noLocation , q ) ) . toBe ( false ) ;
416
+ expect ( matchesQuery ( nullLocation , q ) ) . toBe ( false ) ;
396
417
// Invalid rectangles
397
418
q = new Parse . Query ( 'Checkin' ) . withinGeoBox (
398
419
'location' ,
0 commit comments