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

Commit 6367cc4

Browse files
committed
Add unit test
1 parent df5fdb9 commit 6367cc4

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

test/.eslintrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@
145145
/* urlUtils.js */
146146
"urlResolve": false,
147147
"urlIsSameOrigin": false,
148+
"urlIsSameOriginAsBaseUrl": true,
148149

149150
/* karma */
150151
"dump": false,

test/ng/urlUtilsSpec.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ describe('urlUtils', function() {
2828
function expectIsSameOrigin(url, expectedValue) {
2929
expect(urlIsSameOrigin(url)).toBe(expectedValue);
3030
expect(urlIsSameOrigin(urlResolve(url))).toBe(expectedValue);
31+
32+
// urlIsSameOriginAsBaseUrl() should behave the same as urlIsSameOrigin() by default.
33+
// Behavior when there is a non-default base URL or when the base URL changes dynamically
34+
// is tested in the end-to-end tests in e2e/tests/base-tag.spec.js.
35+
expect(urlIsSameOriginAsBaseUrl(url)).toBe(expectedValue);
36+
expect(urlIsSameOriginAsBaseUrl(urlResolve(url))).toBe(expectedValue);
3137
}
3238
expectIsSameOrigin('path', true);
3339
var origin = urlResolve($document[0].location.href);

0 commit comments

Comments
 (0)