1 import { trimLocalID } from "./urlTests";
3 jest.mock("../config", () => {});
5 describe("urlTests", () => {
6 describe("trimLocalID", () => {
7 it("should keep urls without localID as they are", () => {
8 expect(trimLocalID("https://example.local")).toBe("https://example.local/");
9 expect(trimLocalID("https://example.local/some/path")).toBe("https://example.local/some/path");
10 expect(trimLocalID("https://example.local/u/potato/")).toBe("https://example.local/u/potato/");
13 it("should remove localID from urls", () => {
14 expect(trimLocalID("https://example.local/u/123")).toBe("https://example.local/");
15 expect(trimLocalID("https://example.local/u/123/")).toBe("https://example.local/");
16 expect(trimLocalID("https://example.local/u/456/potato")).toBe("https://example.local/potato");
17 expect(trimLocalID("https://example.local/u/7/tomato/")).toBe("https://example.local/tomato/");