File tree Expand file tree Collapse file tree 1 file changed +39
-1
lines changed Expand file tree Collapse file tree 1 file changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -1451,7 +1451,45 @@ describe('Parse.Query testing', () => {
1451
1451
done ( )
1452
1452
} , ( ) => {
1453
1453
fail ( 'should not fail' ) ;
1454
- console . error ( err ) ;
1454
+ done ( ) ;
1455
+ } )
1456
+ } ) ;
1457
+
1458
+ it ( 'properly includes array of mixed objects' , ( done ) => {
1459
+ let objects = [ ] ;
1460
+ let total = 0 ;
1461
+ while ( objects . length != 5 ) {
1462
+ let object = new Parse . Object ( 'AnObject' ) ;
1463
+ object . set ( 'key' , objects . length ) ;
1464
+ total += objects . length ;
1465
+ objects . push ( object ) ;
1466
+ }
1467
+ while ( objects . length != 10 ) {
1468
+ let object = new Parse . Object ( 'AnotherObject' ) ;
1469
+ object . set ( 'key' , objects . length ) ;
1470
+ total += objects . length ;
1471
+ objects . push ( object ) ;
1472
+ }
1473
+ Parse . Object . saveAll ( objects ) . then ( ( ) => {
1474
+ let object = new Parse . Object ( "AContainer" ) ;
1475
+ object . set ( 'objects' , objects ) ;
1476
+ return object . save ( ) ;
1477
+ } ) . then ( ( ) => {
1478
+ let query = new Parse . Query ( 'AContainer' ) ;
1479
+ query . include ( 'objects' ) ;
1480
+ return query . find ( )
1481
+ } ) . then ( ( results ) => {
1482
+ expect ( results . length ) . toBe ( 1 ) ;
1483
+ let res = results [ 0 ] ;
1484
+ let objects = res . get ( 'objects' ) ;
1485
+ expect ( objects . length ) . toBe ( 10 ) ;
1486
+ objects . forEach ( ( object ) => {
1487
+ total -= object . get ( 'key' ) ;
1488
+ } ) ;
1489
+ expect ( total ) . toBe ( 0 ) ;
1490
+ done ( )
1491
+ } , ( err ) => {
1492
+ fail ( 'should not fail' ) ;
1455
1493
done ( ) ;
1456
1494
} )
1457
1495
} )
You can’t perform that action at this time.
0 commit comments