aboutsummaryrefslogtreecommitdiffstats
path: root/test/service/locationSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/service/locationSpec.js')
-rw-r--r--test/service/locationSpec.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/test/service/locationSpec.js b/test/service/locationSpec.js
index 6cf302fe..9a7aa943 100644
--- a/test/service/locationSpec.js
+++ b/test/service/locationSpec.js
@@ -556,10 +556,11 @@ describe('$location', function() {
var root, link, extLink, $browser, originalBrowser, lastEventPreventDefault;
- function init(linkHref, html5Mode, supportHist, attrs) {
+ function init(linkHref, html5Mode, supportHist, attrs, content) {
var jqRoot = jqLite('<div></div>');
attrs = attrs ? ' ' + attrs + ' ' : '';
- link = jqLite('<a href="' + linkHref + '"' + attrs + '>link</a>')[0];
+ content = content || 'link';
+ link = jqLite('<a href="' + linkHref + '"' + attrs + '>' + content + '</a>')[0];
root = jqRoot.append(link)[0];
jqLite(document.body).append(jqRoot);
@@ -670,6 +671,15 @@ describe('$location', function() {
});
+ it('should rewrite when clicked span inside link', function() {
+ init('some/link', true, true, '', '<span>link</span>');
+ var span = jqLite(link).find('span');
+
+ browserTrigger(span, 'click');
+ expectRewriteTo('http://host.com/base/some/link');
+ });
+
+
// don't run next tests on IE<9, as browserTrigger does not simulate pressed keys
if (!(msie < 9)) {