aboutsummaryrefslogtreecommitdiffstats
path: root/test/directivesSpec.js
diff options
context:
space:
mode:
authorIgor Minar2011-08-20 00:24:24 -0700
committerIgor Minar2011-08-24 15:01:49 -0700
commit30753cb1310893841fdb0b17c075b6a72e8c8d8a (patch)
tree7c07b19f1dd026f6e1f28b3add84e7af10b0b2fd /test/directivesSpec.js
parentdbf8afcba0cfc0e341e3ebd2dadeba627c083f0a (diff)
downloadangular.js-30753cb1310893841fdb0b17c075b6a72e8c8d8a.tar.bz2
feat(ng:cloak): add ng:cloak directive
Diffstat (limited to 'test/directivesSpec.js')
-rw-r--r--test/directivesSpec.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/directivesSpec.js b/test/directivesSpec.js
index 488ebaa2..1d26973c 100644
--- a/test/directivesSpec.js
+++ b/test/directivesSpec.js
@@ -381,4 +381,31 @@ describe("directive", function(){
});
+ describe('ng:cloak', function() {
+
+ it('should get removed when an element is compiled', function() {
+ var element = jqLite('<div ng:cloak></div>');
+
+ expect(element.attr('ng:cloak')).toBe('');
+
+ angular.compile(element)
+
+ expect(element.attr('ng:cloak')).toBeUndefined();
+ });
+
+
+ it('should remove ng-cloak class from a compiled element', function() {
+ var element = jqLite('<div ng:cloak 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);
+
+ angular.compile(element);
+
+ expect(element.hasClass('foo')).toBe(true);
+ expect(element.hasClass('ng-cloak')).toBe(false);
+ expect(element.hasClass('bar')).toBe(true);
+ });
+ });
});