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

Commit 2f32614

Browse files
test($location): ensure that link rewriting is actually being tested
If the link URL is not within the given base URL then the link would not be rewritten anyway. See https://github.com/angular/angular.js/pull/9906/files#r19813651
1 parent 8b33de6 commit 2f32614

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/ng/locationSpec.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -1272,7 +1272,7 @@ describe('$location', function() {
12721272

12731273

12741274
it('should not rewrite links with target="_blank"', function() {
1275-
configureService({linkHref: '/a?b=c', html5Mode: true, supportHist: true, attrs: 'target="_blank"'});
1275+
configureService({linkHref: 'base/a?b=c', html5Mode: true, supportHist: true, attrs: 'target="_blank"'});
12761276
inject(
12771277
initBrowser(),
12781278
initLocation(),
@@ -1285,7 +1285,7 @@ describe('$location', function() {
12851285

12861286

12871287
it('should not rewrite links with target specified', function() {
1288-
configureService({linkHref: '/a?b=c', html5Mode: true, supportHist: true, attrs: 'target="some-frame"'});
1288+
configureService({linkHref: 'base/a?b=c', html5Mode: true, supportHist: true, attrs: 'target="some-frame"'});
12891289
inject(
12901290
initBrowser(),
12911291
initLocation(),
@@ -1480,7 +1480,7 @@ describe('$location', function() {
14801480
});
14811481

14821482
it('should not rewrite when clicked with ctrl pressed', function() {
1483-
configureService({linkHref: '/a?b=c', html5Mode: true, supportHist: true});
1483+
configureService({linkHref: 'base/a?b=c', html5Mode: true, supportHist: true});
14841484
inject(
14851485
initBrowser(),
14861486
initLocation(),
@@ -1493,7 +1493,7 @@ describe('$location', function() {
14931493

14941494

14951495
it('should not rewrite when clicked with meta pressed', function() {
1496-
configureService({linkHref: '/a?b=c', html5Mode: true, supportHist: true});
1496+
configureService({linkHref: 'base/a?b=c', html5Mode: true, supportHist: true});
14971497
inject(
14981498
initBrowser(),
14991499
initLocation(),
@@ -1505,7 +1505,7 @@ describe('$location', function() {
15051505
});
15061506

15071507
it('should not rewrite when right click pressed', function() {
1508-
configureService({linkHref: '/a?b=c', html5Mode: true, supportHist: true});
1508+
configureService({linkHref: 'base/a?b=c', html5Mode: true, supportHist: true});
15091509
inject(
15101510
initBrowser(),
15111511
initLocation(),

0 commit comments

Comments
 (0)