@@ -56,8 +56,7 @@ describe('ComponentNgElementZoneStrategyFactory', () => {
56
56
57
57
it ( 'should connect already in NgZone' , ( ) => {
58
58
const parent = spyOn ( ComponentNgElementStrategy . prototype , 'connect' ) ;
59
- const isInAngularZone =
60
- spyOn ( NgZone , 'isInAngularZone' ) . and . callFake ( function ( ) { return true ; } ) ;
59
+ strategy [ 'elementZone' ] = Zone . current ;
61
60
ngZone . run . calls . reset ( ) ;
62
61
strategy . connect ( document . createElement ( 'div' ) ) ;
63
62
expect ( parent ) . toHaveBeenCalled ( ) ;
@@ -66,8 +65,7 @@ describe('ComponentNgElementZoneStrategyFactory', () => {
66
65
67
66
it ( 'should connect not already in NgZone' , ( ) => {
68
67
const parent = spyOn ( ComponentNgElementStrategy . prototype , 'connect' ) ;
69
- const isInAngularZone =
70
- spyOn ( NgZone , 'isInAngularZone' ) . and . callFake ( function ( ) { return false ; } ) ;
68
+ strategy [ 'elementZone' ] = Zone . current . parent ;
71
69
ngZone . run . calls . reset ( ) ;
72
70
strategy . connect ( document . createElement ( 'div' ) ) ;
73
71
expect ( parent ) . toHaveBeenCalled ( ) ;
@@ -76,8 +74,7 @@ describe('ComponentNgElementZoneStrategyFactory', () => {
76
74
77
75
describe ( 'after connected not in NgZone' , ( ) => {
78
76
beforeEach ( ( ) => {
79
- const isInAngularZone =
80
- spyOn ( NgZone , 'isInAngularZone' ) . and . callFake ( function ( ) { return false ; } ) ;
77
+ strategy [ 'elementZone' ] = Zone . current . parent ;
81
78
strategy . connect ( document . createElement ( 'div' ) ) ;
82
79
ngZone . run . calls . reset ( ) ;
83
80
} ) ;
0 commit comments