21700: Install Bundler system-wide in Rails postinst
[arvados.git] / services / workbench2 / src / services / api / url-builder.test.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { joinUrls } from "services/api/url-builder";
6
7 describe("UrlBuilder", () => {
8     it("should join urls properly 1", () => {
9         expect(joinUrls('http://localhost:3000', '/main')).toEqual('http://localhost:3000/main');
10     });
11     it("should join urls properly 2", () => {
12         expect(joinUrls('http://localhost:3000/', '/main')).toEqual('http://localhost:3000/main');
13     });
14     it("should join urls properly 3", () => {
15         expect(joinUrls('http://localhost:3000//', '/main')).toEqual('http://localhost:3000/main');
16     });
17     it("should join urls properly 4", () => {
18         expect(joinUrls('http://localhost:3000', '//main')).toEqual('http://localhost:3000/main');
19     });
20     it("should join urls properly 5", () => {
21         expect(joinUrls('http://localhost:3000///', 'main')).toEqual('http://localhost:3000/main');
22     });
23     it("should join urls properly 6", () => {
24         expect(joinUrls('http://localhost:3000///', '//main')).toEqual('http://localhost:3000/main');
25     });
26     it("should join urls properly 7", () => {
27         expect(joinUrls(undefined, '//main')).toEqual('/main');
28     });
29     it("should join urls properly 8", () => {
30         expect(joinUrls(undefined, 'main')).toEqual('/main');
31     });
32     it("should join urls properly 9", () => {
33         expect(joinUrls('http://localhost:3000///', undefined)).toEqual('http://localhost:3000');
34     });
35 });