1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { OrderBuilder } from "./order-builder";
6 import { joinUrls } from "~/services/api/url-builder";
8 describe("UrlBuilder", () => {
9 it("should join urls properly 1", () => {
10 expect(joinUrls('http://localhost:3000', '/main')).toEqual('http://localhost:3000/main');
12 it("should join urls properly 2", () => {
13 expect(joinUrls('http://localhost:3000/', '/main')).toEqual('http://localhost:3000/main');
15 it("should join urls properly 3", () => {
16 expect(joinUrls('http://localhost:3000//', '/main')).toEqual('http://localhost:3000/main');
18 it("should join urls properly 4", () => {
19 expect(joinUrls('http://localhost:3000', '//main')).toEqual('http://localhost:3000/main');
21 it("should join urls properly 5", () => {
22 expect(joinUrls('http://localhost:3000///', 'main')).toEqual('http://localhost:3000/main');
24 it("should join urls properly 6", () => {
25 expect(joinUrls('http://localhost:3000///', '//main')).toEqual('http://localhost:3000/main');
27 it("should join urls properly 7", () => {
28 expect(joinUrls(undefined, '//main')).toEqual('/main');
30 it("should join urls properly 8", () => {
31 expect(joinUrls(undefined, 'main')).toEqual('/main');
33 it("should join urls properly 9", () => {
34 expect(joinUrls('http://localhost:3000///', undefined)).toEqual('http://localhost:3000');