diff options
Diffstat (limited to 'test/ng/directive/ngClassSpec.js')
| -rw-r--r-- | test/ng/directive/ngClassSpec.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/ng/directive/ngClassSpec.js b/test/ng/directive/ngClassSpec.js index 4a53030b..69afef7a 100644 --- a/test/ng/directive/ngClassSpec.js +++ b/test/ng/directive/ngClassSpec.js @@ -236,6 +236,17 @@ describe('ngClass', function() { })); + it('should not mess up class value due to observing an interpolated class attribute', inject(function($rootScope, $compile) { + $rootScope.foo = true; + $rootScope.$watch("anything", function() { + $rootScope.foo = false; + }); + element = $compile('<div ng-class="{foo:foo}"></div>')($rootScope); + $rootScope.$digest(); + expect(element.hasClass('foo')).toBe(false); + })); + + it('should update ngClassOdd/Even when model is changed by filtering', inject(function($rootScope, $compile) { element = $compile('<ul>' + '<li ng-repeat="i in items" ' + |
