diff options
| author | Misko Hevery | 2012-03-08 16:11:32 -0800 |
|---|---|---|
| committer | Misko Hevery | 2012-03-08 16:30:39 -0800 |
| commit | dd7b0f56fcd9785f7fccae8c4f088a8f3e7b125e (patch) | |
| tree | e3566653ce4047ee9f3ae1d8c0a294aa2541cbcf /test/directivesSpec.js | |
| parent | b3750103cc2c696b4ecadd7eebc55a76fd528bce (diff) | |
| download | angular.js-dd7b0f56fcd9785f7fccae8c4f088a8f3e7b125e.tar.bz2 | |
fix(ng-cloak): work with class
Diffstat (limited to 'test/directivesSpec.js')
| -rw-r--r-- | test/directivesSpec.js | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/test/directivesSpec.js b/test/directivesSpec.js index c0533745..1ce6090b 100644 --- a/test/directivesSpec.js +++ b/test/directivesSpec.js @@ -543,7 +543,7 @@ describe("directive", function() { })); - it('should remove ng-cloak class from a compiled element', inject(function($rootScope, $compile) { + it('should remove ng-cloak class from a compiled element with attribute', inject(function($rootScope, $compile) { element = jqLite('<div ng:cloak class="foo ng-cloak bar"></div>'); expect(element.hasClass('foo')).toBe(true); @@ -556,6 +556,21 @@ describe("directive", function() { expect(element.hasClass('ng-cloak')).toBe(false); expect(element.hasClass('bar')).toBe(true); })); + + + it('should remove ng-cloak class from a compiled element', inject(function($rootScope, $compile) { + element = jqLite('<div class="foo ng-cloak bar"></div>'); + + expect(element.hasClass('foo')).toBe(true); + expect(element.hasClass('ng-cloak')).toBe(true); + expect(element.hasClass('bar')).toBe(true); + + $compile(element); + + expect(element.hasClass('foo')).toBe(true); + expect(element.hasClass('ng-cloak')).toBe(false); + expect(element.hasClass('bar')).toBe(true); + })); }); |
