@@ -3474,6 +3474,50 @@ describe('Parse.Query testing', () => {
3474
3474
} ) ;
3475
3475
} ) ;
3476
3476
3477
+ it ( 'include with *' , async ( ) => {
3478
+ const child1 = new TestObject ( { foo : 'bar' , name : 'ac' } ) ;
3479
+ const child2 = new TestObject ( { foo : 'baz' , name : 'flo' } ) ;
3480
+ const child3 = new TestObject ( { foo : 'bad' , name : 'mo' } ) ;
3481
+ const parent = new Container ( { child1, child2, child3 } ) ;
3482
+ await Parse . Object . saveAll ( [ parent , child1 , child2 , child3 ] ) ;
3483
+ const options = Object . assign ( { } , masterKeyOptions , {
3484
+ body : {
3485
+ where : { objectId : parent . id } ,
3486
+ include : '*' ,
3487
+ }
3488
+ } ) ;
3489
+ const resp = await rp . get ( Parse . serverURL + "/classes/Container" , options ) ;
3490
+ const result = resp . results [ 0 ] ;
3491
+ equal ( result . child1 . foo , 'bar' ) ;
3492
+ equal ( result . child2 . foo , 'baz' ) ;
3493
+ equal ( result . child3 . foo , 'bad' ) ;
3494
+ equal ( result . child1 . name , 'ac' ) ;
3495
+ equal ( result . child2 . name , 'flo' ) ;
3496
+ equal ( result . child3 . name , 'mo' ) ;
3497
+ } ) ;
3498
+
3499
+ it ( 'include with * overrides' , async ( ) => {
3500
+ const child1 = new TestObject ( { foo : 'bar' , name : 'ac' } ) ;
3501
+ const child2 = new TestObject ( { foo : 'baz' , name : 'flo' } ) ;
3502
+ const child3 = new TestObject ( { foo : 'bad' , name : 'mo' } ) ;
3503
+ const parent = new Container ( { child1, child2, child3 } ) ;
3504
+ await Parse . Object . saveAll ( [ parent , child1 , child2 , child3 ] ) ;
3505
+ const options = Object . assign ( { } , masterKeyOptions , {
3506
+ body : {
3507
+ where : { objectId : parent . id } ,
3508
+ include : 'child2,*' ,
3509
+ }
3510
+ } ) ;
3511
+ const resp = await rp . get ( Parse . serverURL + "/classes/Container" , options ) ;
3512
+ const result = resp . results [ 0 ] ;
3513
+ equal ( result . child1 . foo , 'bar' ) ;
3514
+ equal ( result . child2 . foo , 'baz' ) ;
3515
+ equal ( result . child3 . foo , 'bad' ) ;
3516
+ equal ( result . child1 . name , 'ac' ) ;
3517
+ equal ( result . child2 . name , 'flo' ) ;
3518
+ equal ( result . child3 . name , 'mo' ) ;
3519
+ } ) ;
3520
+
3477
3521
it ( 'includeAll' , ( done ) => {
3478
3522
const child1 = new TestObject ( { foo : 'bar' , name : 'ac' } ) ;
3479
3523
const child2 = new TestObject ( { foo : 'baz' , name : 'flo' } ) ;
0 commit comments