@@ -390,15 +390,19 @@ describe('miscellaneous', function() {
390
390
var object = req . object ;
391
391
expect ( object instanceof Parse . Object ) . toBeTruthy ( ) ;
392
392
expect ( object . get ( 'fooAgain' ) ) . toEqual ( 'barAgain' ) ;
393
- expect ( object . id ) . not . toBeUndefined ( ) ;
394
- expect ( object . createdAt ) . not . toBeUndefined ( ) ;
395
- expect ( object . updatedAt ) . not . toBeUndefined ( ) ;
396
393
if ( triggerTime == 0 ) {
397
394
// Create
398
395
expect ( object . get ( 'foo' ) ) . toEqual ( 'bar' ) ;
396
+ // No objectId/createdAt/updatedAt
397
+ expect ( object . id ) . toBeUndefined ( ) ;
398
+ expect ( object . createdAt ) . toBeUndefined ( ) ;
399
+ expect ( object . updatedAt ) . toBeUndefined ( ) ;
399
400
} else if ( triggerTime == 1 ) {
400
401
// Update
401
402
expect ( object . get ( 'foo' ) ) . toEqual ( 'baz' ) ;
403
+ expect ( object . id ) . not . toBeUndefined ( ) ;
404
+ expect ( object . createdAt ) . not . toBeUndefined ( ) ;
405
+ expect ( object . updatedAt ) . not . toBeUndefined ( ) ;
402
406
} else {
403
407
res . error ( ) ;
404
408
}
@@ -431,10 +435,10 @@ describe('miscellaneous', function() {
431
435
Parse . Cloud . afterSave ( 'GameScore' , function ( req , res ) {
432
436
var object = req . object ;
433
437
expect ( object instanceof Parse . Object ) . toBeTruthy ( ) ;
434
- expect ( object . get ( 'fooAgain' ) ) . toEqual ( 'barAgain' ) ;
435
438
expect ( object . id ) . not . toBeUndefined ( ) ;
436
439
expect ( object . createdAt ) . not . toBeUndefined ( ) ;
437
440
expect ( object . updatedAt ) . not . toBeUndefined ( ) ;
441
+ expect ( object . get ( 'fooAgain' ) ) . toEqual ( 'barAgain' ) ;
438
442
if ( triggerTime == 0 ) {
439
443
// Create
440
444
expect ( object . get ( 'foo' ) ) . toEqual ( 'bar' ) ;
@@ -474,17 +478,21 @@ describe('miscellaneous', function() {
474
478
var object = req . object ;
475
479
expect ( object instanceof Parse . Object ) . toBeTruthy ( ) ;
476
480
expect ( object . get ( 'fooAgain' ) ) . toEqual ( 'barAgain' ) ;
477
- expect ( object . id ) . not . toBeUndefined ( ) ;
478
- expect ( object . createdAt ) . not . toBeUndefined ( ) ;
479
- expect ( object . updatedAt ) . not . toBeUndefined ( ) ;
480
481
var originalObject = req . original ;
481
482
if ( triggerTime == 0 ) {
483
+ // No id/createdAt/updatedAt
484
+ expect ( object . id ) . toBeUndefined ( ) ;
485
+ expect ( object . createdAt ) . toBeUndefined ( ) ;
486
+ expect ( object . updatedAt ) . toBeUndefined ( ) ;
482
487
// Create
483
488
expect ( object . get ( 'foo' ) ) . toEqual ( 'bar' ) ;
484
489
// Check the originalObject is undefined
485
490
expect ( originalObject ) . toBeUndefined ( ) ;
486
491
} else if ( triggerTime == 1 ) {
487
492
// Update
493
+ expect ( object . id ) . not . toBeUndefined ( ) ;
494
+ expect ( object . createdAt ) . not . toBeUndefined ( ) ;
495
+ expect ( object . updatedAt ) . not . toBeUndefined ( ) ;
488
496
expect ( object . get ( 'foo' ) ) . toEqual ( 'baz' ) ;
489
497
// Check the originalObject
490
498
expect ( originalObject instanceof Parse . Object ) . toBeTruthy ( ) ;
0 commit comments