Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit f7f4417

Browse files
committed
test($compile): skip failing foreignObject test on MS Edge
For unknown reasons, an `<svg>` element inside a `<foreignObject>` element on MS Edge seems to have no size, causing the included `<circle>` element to have no size as well and thus fails an assertion (relying on the element having a non-zero size). This seems to be an MS Edge issue; i.e. it is also reproducible without Angular. (Tested with MS Edge version 25.10586.0.0 on Windows 10.)
1 parent a2d5ef7 commit f7f4417

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

test/ng/compileSpec.js

+16-11
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,9 @@ describe('$compile', function() {
230230

231231

232232
describe('svg namespace transcludes', function() {
233+
var ua = window.navigator.userAgent;
234+
var isEdge = /Edge/.test(ua);
235+
233236
// this method assumes some sort of sized SVG element is being inspected.
234237
function assertIsValidSvgCircle(elem) {
235238
expect(isUnknownElement(elem)).toBe(false);
@@ -300,17 +303,19 @@ describe('$compile', function() {
300303
}));
301304

302305
// NOTE: This test may be redundant.
303-
it('should handle custom svg containers that transclude to foreignObject' +
304-
' that transclude to custom svg containers that transclude to custom elements', inject(function() {
305-
element = jqLite('<div><svg-container>' +
306-
'<my-foreign-object><svg-container><svg-circle></svg-circle></svg-container></my-foreign-object>' +
307-
'</svg-container></div>');
308-
$compile(element.contents())($rootScope);
309-
document.body.appendChild(element[0]);
310-
311-
var circle = element.find('circle');
312-
assertIsValidSvgCircle(circle[0]);
313-
}));
306+
if (!isEdge) {
307+
it('should handle custom svg containers that transclude to foreignObject' +
308+
' that transclude to custom svg containers that transclude to custom elements', inject(function() {
309+
element = jqLite('<div><svg-container>' +
310+
'<my-foreign-object><svg-container><svg-circle></svg-circle></svg-container></my-foreign-object>' +
311+
'</svg-container></div>');
312+
$compile(element.contents())($rootScope);
313+
document.body.appendChild(element[0]);
314+
315+
var circle = element.find('circle');
316+
assertIsValidSvgCircle(circle[0]);
317+
}));
318+
}
314319
}
315320

316321
it('should handle directives with templates that manually add the transclude further down', inject(function() {

0 commit comments

Comments
 (0)