@@ -704,29 +704,36 @@ export function main() {
704704 } ) ;
705705
706706 describe ( 'marking ON_PUSH detectors as CHECK_ONCE after an update' , ( ) => {
707- var checkedDetector ;
707+ var childDirectiveDetectorRegular ;
708+ var childDirectiveDetectorOnPush ;
708709 var directives ;
709710
710711 beforeEach ( ( ) => {
711- checkedDetector = _createWithoutHydrate ( 'emptyUsingOnPushStrategy' ) . changeDetector ;
712- checkedDetector . hydrate ( _DEFAULT_CONTEXT , null , null , null ) ;
713- checkedDetector . mode = CHECKED ;
714-
715- var targetDirective = new TestData ( null ) ;
716- directives = new FakeDirectives ( [ targetDirective ] , [ checkedDetector ] ) ;
712+ childDirectiveDetectorRegular = _createWithoutHydrate ( '10' ) . changeDetector ;
713+ childDirectiveDetectorRegular . hydrate ( _DEFAULT_CONTEXT , null , null , null ) ;
714+ childDirectiveDetectorRegular . mode = CHECK_ALWAYS ;
715+
716+ childDirectiveDetectorOnPush =
717+ _createWithoutHydrate ( 'emptyUsingOnPushStrategy' ) . changeDetector ;
718+ childDirectiveDetectorOnPush . hydrate ( _DEFAULT_CONTEXT , null , null , null ) ;
719+ childDirectiveDetectorOnPush . mode = CHECKED ;
720+
721+ directives =
722+ new FakeDirectives ( [ new TestData ( null ) , new TestData ( null ) ] ,
723+ [ childDirectiveDetectorRegular , childDirectiveDetectorOnPush ] ) ;
717724 } ) ;
718725
719726 it ( 'should set the mode to CHECK_ONCE when a binding is updated' , ( ) => {
720- var cd = _createWithoutHydrate ( 'onPushRecordsUsingDefaultStrategy' ) . changeDetector ;
721- cd . hydrate ( _DEFAULT_CONTEXT , null , directives , null ) ;
727+ var parentDetector =
728+ _createWithoutHydrate ( 'onPushRecordsUsingDefaultStrategy' ) . changeDetector ;
729+ parentDetector . hydrate ( _DEFAULT_CONTEXT , null , directives , null ) ;
722730
723- expect ( checkedDetector . mode ) . toEqual ( CHECKED ) ;
731+ parentDetector . detectChanges ( ) ;
724732
725- // evaluate the record, update the targetDirective, and mark its detector as
726- // CHECK_ONCE
727- cd . detectChanges ( ) ;
733+ // making sure that we only change the status of ON_PUSH components
734+ expect ( childDirectiveDetectorRegular . mode ) . toEqual ( CHECK_ALWAYS ) ;
728735
729- expect ( checkedDetector . mode ) . toEqual ( CHECK_ONCE ) ;
736+ expect ( childDirectiveDetectorOnPush . mode ) . toEqual ( CHECK_ONCE ) ;
730737 } ) ;
731738
732739 it ( 'should mark ON_PUSH detectors as CHECK_ONCE after an event' , ( ) => {
@@ -745,7 +752,7 @@ export function main() {
745752
746753 cd . handleEvent ( "host-event" , 0 , null ) ;
747754
748- expect ( checkedDetector . mode ) . toEqual ( CHECK_ONCE ) ;
755+ expect ( childDirectiveDetectorOnPush . mode ) . toEqual ( CHECK_ONCE ) ;
749756 } ) ;
750757
751758 if ( IS_DART ) {
0 commit comments