This repository was archived by the owner on Apr 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -3321,6 +3321,32 @@ describe('parser', function() {
3321
3321
scope . $digest ( ) ;
3322
3322
expect ( called ) . toBe ( true ) ;
3323
3323
} ) ) ;
3324
+
3325
+ it ( 'should not effect when a one-time binding becomes stable' , inject ( function ( $parse ) {
3326
+ scope . $watch ( $parse ( '::x' ) ) ;
3327
+ scope . $watch ( $parse ( '::x' , identity ) ) ;
3328
+ scope . $watch ( $parse ( '::x' , function ( ) { return 1 ; } ) ) ; //interceptor that returns non-undefined
3329
+
3330
+ scope . $digest ( ) ;
3331
+ expect ( scope . $$watchersCount ) . toBe ( 3 ) ;
3332
+
3333
+ scope . x = 1 ;
3334
+ scope . $digest ( ) ;
3335
+ expect ( scope . $$watchersCount ) . toBe ( 0 ) ;
3336
+ } ) ) ;
3337
+
3338
+ it ( 'should not effect when a one-time literal binding becomes stable' , inject ( function ( $parse ) {
3339
+ scope . $watch ( $parse ( '::[x]' ) ) ;
3340
+ scope . $watch ( $parse ( '::[x]' , identity ) ) ;
3341
+ scope . $watch ( $parse ( '::[x]' , function ( ) { return 1 ; } ) ) ; //interceptor that returns non-literal
3342
+
3343
+ scope . $digest ( ) ;
3344
+ expect ( scope . $$watchersCount ) . toBe ( 3 ) ;
3345
+
3346
+ scope . x = 1 ;
3347
+ scope . $digest ( ) ;
3348
+ expect ( scope . $$watchersCount ) . toBe ( 0 ) ;
3349
+ } ) ) ;
3324
3350
} ) ;
3325
3351
3326
3352
describe ( 'literals' , function ( ) {
You can’t perform that action at this time.
0 commit comments