File tree 1 file changed +26
-0
lines changed
1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -3340,6 +3340,32 @@ describe('parser', function() {
3340
3340
scope . $digest ( ) ;
3341
3341
expect ( called ) . toBe ( true ) ;
3342
3342
} ) ) ;
3343
+
3344
+ it ( 'should not affect when a one-time binding becomes stable' , inject ( function ( $parse ) {
3345
+ scope . $watch ( $parse ( '::x' ) ) ;
3346
+ scope . $watch ( $parse ( '::x' , identity ) ) ;
3347
+ scope . $watch ( $parse ( '::x' , function ( ) { return 1 ; } ) ) ; //interceptor that returns non-undefined
3348
+
3349
+ scope . $digest ( ) ;
3350
+ expect ( scope . $$watchersCount ) . toBe ( 3 ) ;
3351
+
3352
+ scope . x = 1 ;
3353
+ scope . $digest ( ) ;
3354
+ expect ( scope . $$watchersCount ) . toBe ( 0 ) ;
3355
+ } ) ) ;
3356
+
3357
+ it ( 'should not affect when a one-time literal binding becomes stable' , inject ( function ( $parse ) {
3358
+ scope . $watch ( $parse ( '::[x]' ) ) ;
3359
+ scope . $watch ( $parse ( '::[x]' , identity ) ) ;
3360
+ scope . $watch ( $parse ( '::[x]' , function ( ) { return 1 ; } ) ) ; //interceptor that returns non-literal
3361
+
3362
+ scope . $digest ( ) ;
3363
+ expect ( scope . $$watchersCount ) . toBe ( 3 ) ;
3364
+
3365
+ scope . x = 1 ;
3366
+ scope . $digest ( ) ;
3367
+ expect ( scope . $$watchersCount ) . toBe ( 0 ) ;
3368
+ } ) ) ;
3343
3369
} ) ;
3344
3370
3345
3371
describe ( 'literals' , function ( ) {
You can’t perform that action at this time.
0 commit comments