diff options
Diffstat (limited to 'test/ScopeSpec.js')
| -rw-r--r-- | test/ScopeSpec.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/ScopeSpec.js b/test/ScopeSpec.js index a2ad57a3..6105df21 100644 --- a/test/ScopeSpec.js +++ b/test/ScopeSpec.js @@ -178,6 +178,15 @@ describe('Scope', function(){ expect(log).toEqual('abc'); }); + it('should repeat watch cycle from the root elemnt', function(){ + var log = ''; + var child = root.$new(); + root.$watch(function(){ log += 'a'; }); + child.$watch(function(){ log += 'b'; }); + root.$digest(); + expect(log).toEqual('abab'); + }); + it('should prevent infinite recursion', function(){ root.$watch('a', function(self, v){self.b++;}); |
