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

Commit 1f8431b

Browse files
Andy Pattersonpetebacondarwin
Andy Patterson
authored andcommitted
test(booleanAttrsSpec): add unit test for IE11 URL parsing failure
IE11/10/Edge fail when setting a href to a URL containing a % that isn't a valid escape sequence See #13388 Closes #13458
1 parent b8773a7 commit 1f8431b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test/ng/directive/booleanAttrsSpec.js

+12
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,18 @@ describe('ngHref', function() {
283283
expect(element.attr('href')).toEqual(undefined);
284284
}));
285285

286+
if (msie) {
287+
// IE11/10/Edge fail when setting a href to a URL containing a % that isn't a valid escape sequence
288+
// See https://github.com/angular/angular.js/issues/13388
289+
it('should throw error if ng-href contains a non-escaped percent symbol', inject(function($rootScope, $compile) {
290+
element = $compile('<a ng-href="http://www.google.com/{{\'a%link\'}}">')($rootScope);
291+
292+
expect(function() {
293+
$rootScope.$digest();
294+
}).toThrow();
295+
}));
296+
}
297+
286298
if (isDefined(window.SVGElement)) {
287299
describe('SVGAElement', function() {
288300
it('should interpolate the expression and bind to xlink:href', inject(function($compile, $rootScope) {

0 commit comments

Comments
 (0)