Skip to content

Commit 4a48faa

Browse files
committed
tweak tests
1 parent ddf78a7 commit 4a48faa

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

web_src/js/webcomponents/GiteaOriginUrl.test.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@ test('toOriginUrl', () => {
66
window.location = new URL(`${origin}/`);
77
expect(toOriginUrl('/')).toEqual(`${origin}/`);
88
expect(toOriginUrl('/org/repo.git')).toEqual(`${origin}/org/repo.git`);
9-
expect(toOriginUrl('https://localhost/org/repo.git')).toEqual(`${origin}/org/repo.git`);
10-
expect(toOriginUrl('https://localhost:5000')).toEqual(`${origin}/`);
11-
expect(toOriginUrl('https://localhost:5000/org/repo.git')).toEqual(`${origin}/org/repo.git`);
9+
expect(toOriginUrl('https://another.com')).toEqual(`${origin}/`);
10+
expect(toOriginUrl('https://another.com/')).toEqual(`${origin}/`);
11+
expect(toOriginUrl('https://another.com/org/repo.git')).toEqual(`${origin}/org/repo.git`);
12+
expect(toOriginUrl('https://another.com:5000')).toEqual(`${origin}/`);
13+
expect(toOriginUrl('https://another.com:5000/')).toEqual(`${origin}/`);
14+
expect(toOriginUrl('https://another.com:5000/org/repo.git')).toEqual(`${origin}/org/repo.git`);
1215
}
1316
window.location = oldLocation;
1417
});

0 commit comments

Comments
 (0)