diff options
| author | Igor Minar | 2013-12-31 01:36:01 -0800 |
|---|---|---|
| committer | Igor Minar | 2013-12-31 01:39:19 -0800 |
| commit | e415e916e85040fe62c801092be698ab06c1d11c (patch) | |
| tree | e490e64843b628835a473d7df5b4c71af93f0785 /test/ng/compileSpec.js | |
| parent | 07084e1c8bd4efa28b3f02aea353640af0cf37d6 (diff) | |
| download | angular.js-e415e916e85040fe62c801092be698ab06c1d11c.tar.bz2 | |
test(compileSpec): fix broken build on FF
FF 26.0 now throws:
"TypeError: NodeList doesn't have an indexed property setter."
when we try to assign to `childNodes[1]`, since this test still works properly
on Chrome and the issue being tested is not a cross-browser issues, I'm
just making the patchability check more robust instead of trying to figure
out how to make this test fully pass on FF.
Diffstat (limited to 'test/ng/compileSpec.js')
| -rwxr-xr-x | test/ng/compileSpec.js | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/test/ng/compileSpec.js b/test/ng/compileSpec.js index 39e23695..c37461fc 100755 --- a/test/ng/compileSpec.js +++ b/test/ng/compileSpec.js @@ -202,9 +202,14 @@ describe('$compile', function() { if (msie < 9) return; element = jqLite('<div>{{1+2}}</div>'); - element[0].childNodes[1] = {nodeType: 3, nodeName: 'OBJECT', textContent: 'fake node'}; - if (!element[0].childNodes[1]) return; //browser doesn't support this kind of mocking + try { + element[0].childNodes[1] = {nodeType: 3, nodeName: 'OBJECT', textContent: 'fake node'}; + } catch(e) { + } finally { + if (!element[0].childNodes[1]) return; //browser doesn't support this kind of mocking + } + expect(element[0].childNodes[1].textContent).toBe('fake node'); $compile(element)($rootScope); @@ -4243,7 +4248,7 @@ describe('$compile', function() { expect(element.attr('test2')).toBe('Misko'); expect(element.attr('test3')).toBe('Misko'); })); - + it('should work with the "href" attribute', inject(function($compile, $rootScope) { $rootScope.value = 'test'; element = $compile('<a ng-attr-href="test/{{value}}"></a>')($rootScope); |
