i18n: Upgrade translations from crowdin (253f51dd). (pass-extension)
[ProtonMail-WebClient.git] / applications / inbox-desktop / src / utils / urls / urlTests.test.ts
blobba7014fea58b79f93e28578ee65ec993e3f0bd24
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/");
11         });
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/");
18         });
19     });
20 });