@@ -390,15 +390,19 @@ describe('miscellaneous', function() {
390390 var object = req . object ;
391391 expect ( object instanceof Parse . Object ) . toBeTruthy ( ) ;
392392 expect ( object . get ( 'fooAgain' ) ) . toEqual ( 'barAgain' ) ;
393- expect ( object . id ) . not . toBeUndefined ( ) ;
394- expect ( object . createdAt ) . not . toBeUndefined ( ) ;
395- expect ( object . updatedAt ) . not . toBeUndefined ( ) ;
396393 if ( triggerTime == 0 ) {
397394 // Create
398395 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 ( ) ;
399400 } else if ( triggerTime == 1 ) {
400401 // Update
401402 expect ( object . get ( 'foo' ) ) . toEqual ( 'baz' ) ;
403+ expect ( object . id ) . not . toBeUndefined ( ) ;
404+ expect ( object . createdAt ) . not . toBeUndefined ( ) ;
405+ expect ( object . updatedAt ) . not . toBeUndefined ( ) ;
402406 } else {
403407 res . error ( ) ;
404408 }
@@ -431,10 +435,10 @@ describe('miscellaneous', function() {
431435 Parse . Cloud . afterSave ( 'GameScore' , function ( req , res ) {
432436 var object = req . object ;
433437 expect ( object instanceof Parse . Object ) . toBeTruthy ( ) ;
434- expect ( object . get ( 'fooAgain' ) ) . toEqual ( 'barAgain' ) ;
435438 expect ( object . id ) . not . toBeUndefined ( ) ;
436439 expect ( object . createdAt ) . not . toBeUndefined ( ) ;
437440 expect ( object . updatedAt ) . not . toBeUndefined ( ) ;
441+ expect ( object . get ( 'fooAgain' ) ) . toEqual ( 'barAgain' ) ;
438442 if ( triggerTime == 0 ) {
439443 // Create
440444 expect ( object . get ( 'foo' ) ) . toEqual ( 'bar' ) ;
@@ -474,17 +478,21 @@ describe('miscellaneous', function() {
474478 var object = req . object ;
475479 expect ( object instanceof Parse . Object ) . toBeTruthy ( ) ;
476480 expect ( object . get ( 'fooAgain' ) ) . toEqual ( 'barAgain' ) ;
477- expect ( object . id ) . not . toBeUndefined ( ) ;
478- expect ( object . createdAt ) . not . toBeUndefined ( ) ;
479- expect ( object . updatedAt ) . not . toBeUndefined ( ) ;
480481 var originalObject = req . original ;
481482 if ( triggerTime == 0 ) {
483+ // No id/createdAt/updatedAt
484+ expect ( object . id ) . toBeUndefined ( ) ;
485+ expect ( object . createdAt ) . toBeUndefined ( ) ;
486+ expect ( object . updatedAt ) . toBeUndefined ( ) ;
482487 // Create
483488 expect ( object . get ( 'foo' ) ) . toEqual ( 'bar' ) ;
484489 // Check the originalObject is undefined
485490 expect ( originalObject ) . toBeUndefined ( ) ;
486491 } else if ( triggerTime == 1 ) {
487492 // Update
493+ expect ( object . id ) . not . toBeUndefined ( ) ;
494+ expect ( object . createdAt ) . not . toBeUndefined ( ) ;
495+ expect ( object . updatedAt ) . not . toBeUndefined ( ) ;
488496 expect ( object . get ( 'foo' ) ) . toEqual ( 'baz' ) ;
489497 // Check the originalObject
490498 expect ( originalObject instanceof Parse . Object ) . toBeTruthy ( ) ;
0 commit comments