aboutsummaryrefslogtreecommitdiffstats
path: root/test/ng/locationSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/ng/locationSpec.js')
-rw-r--r--test/ng/locationSpec.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/ng/locationSpec.js b/test/ng/locationSpec.js
index 88747dff..cdad1f1f 100644
--- a/test/ng/locationSpec.js
+++ b/test/ng/locationSpec.js
@@ -1087,6 +1087,21 @@ describe('$location', function() {
expect(event.preventDefault).not.toHaveBeenCalled();
});
});
+
+
+ // regression https://github.com/angular/angular.js/issues/1058
+ it('should not throw if element was removed', inject(function($document, $rootElement, $location) {
+ // we need to do this otherwise we can't simulate events
+ $document.find('body').append($rootElement);
+
+ $rootElement.html('<button></button>');
+ var button = $rootElement.find('button');
+
+ button.bind('click', function() {
+ button.remove();
+ });
+ browserTrigger(button, 'click');
+ }));
});