aboutsummaryrefslogtreecommitdiffstats
path: root/test/AngularSpec.js
diff options
context:
space:
mode:
authorIgor Minar2011-04-07 14:36:41 -0700
committerIgor Minar2011-04-07 14:56:57 -0700
commit0d2d7025e60095afc3497c6cd4a4af9e0cd9b90e (patch)
treea8629b17ac0f76f59a45ef8e799ac6dfc825795d /test/AngularSpec.js
parentd517bcad5b4db5a1a60159df537e69b70702a381 (diff)
downloadangular.js-0d2d7025e60095afc3497c6cd4a4af9e0cd9b90e.tar.bz2
use special nodeName_ impl only for IE<9
apparently IE9 is one step closer to becoming a real browser by treating xmlns-like ("foo:") prefixes in node names as part of the node name. fixes: https://groups.google.com/forum/?lnk=srg#!topic/angular/TGdrV4GsL8U
Diffstat (limited to 'test/AngularSpec.js')
-rw-r--r--test/AngularSpec.js21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/AngularSpec.js b/test/AngularSpec.js
index 9b3357e5..444b9448 100644
--- a/test/AngularSpec.js
+++ b/test/AngularSpec.js
@@ -562,4 +562,25 @@ describe('angular', function(){
expect(scope.greeting).toEqual('hello world');
});
});
+
+
+ describe('nodeName_', function() {
+ it('should correctly detect node name with "namespace" when xmlns is defined', function() {
+ var div = jqLite('<div xmlns:ngtest="http://angularjs.org/">' +
+ '<ngtest:foo ngtest:attr="bar"></ng:test>' +
+ '</div>')[0];
+ expect(nodeName_(div.childNodes[0])).toBe('NGTEST:FOO');
+ expect(div.childNodes[0].getAttribute('ngtest:attr')).toBe('bar');
+ });
+
+ if (!msie || msie >= 9) {
+ it('should correctly detect node name with "namespace" when xmlns is NOT defined', function() {
+ var div = jqLite('<div xmlns:ngtest="http://angularjs.org/">' +
+ '<ngtest:foo ngtest:attr="bar"></ng:test>' +
+ '</div>')[0];
+ expect(nodeName_(div.childNodes[0])).toBe('NGTEST:FOO');
+ expect(div.childNodes[0].getAttribute('ngtest:attr')).toBe('bar');
+ });
+ }
+ });
});