diff options
Diffstat (limited to 'test/AngularSpec.js')
| -rw-r--r-- | test/AngularSpec.js | 21 |
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'); + }); + } + }); }); |
