* fix(integrations): preserve Nextcloud subpaths * Keep existing Nextcloud DAV endpoints intact --------- Co-authored-by: Artur <145776561+arturict@users.noreply.github.com> Co-authored-by: arturict <arturict@users.noreply.github.com>
30 lines
1.0 KiB
TypeScript
30 lines
1.0 KiB
TypeScript
import { describe, expect, test } from "vitest";
|
|
|
|
import { createNextcloudCalendarServerUrl } from "../nextcloud-url";
|
|
|
|
describe("createNextcloudCalendarServerUrl", () => {
|
|
test("uses the DAV endpoint for a root installation", () => {
|
|
expect(createNextcloudCalendarServerUrl("https://cloud.example.com")).toBe(
|
|
"https://cloud.example.com/remote.php/dav/",
|
|
);
|
|
});
|
|
|
|
test("preserves the base path for a subpath installation", () => {
|
|
expect(createNextcloudCalendarServerUrl("https://example.com/nextcloud")).toBe(
|
|
"https://example.com/nextcloud/remote.php/dav/",
|
|
);
|
|
});
|
|
|
|
test("does not duplicate a trailing slash", () => {
|
|
expect(createNextcloudCalendarServerUrl("https://example.com/nextcloud/")).toBe(
|
|
"https://example.com/nextcloud/remote.php/dav/",
|
|
);
|
|
});
|
|
|
|
test("does not duplicate an existing DAV endpoint", () => {
|
|
expect(createNextcloudCalendarServerUrl("https://example.com/nextcloud/remote.php/dav")).toBe(
|
|
"https://example.com/nextcloud/remote.php/dav/",
|
|
);
|
|
});
|
|
});
|