Files
outline/server/models/helpers/SubscriptionHelper.test.ts
Tom Moor a48f6c7a85 fix: Unsubscribe link for collection subscriptions (#8734)
* fix: Cannot unsubscribe from collection subscriptions via email token

* tests

* Separate redirect for pass through

* Delete both subscriptions

* Test draft documents
2025-03-22 08:22:20 -07:00

21 lines
656 B
TypeScript

import { v4 as uuidv4 } from "uuid";
import env from "@server/env";
import SubscriptionHelper from "./SubscriptionHelper";
describe("SubscriptionHelper", () => {
describe("unsubscribeUrl", () => {
it("should return a valid unsubscribe URL", () => {
const userId = uuidv4();
const documentId = uuidv4();
const unsubscribeUrl = SubscriptionHelper.unsubscribeUrl(
userId,
documentId
);
expect(unsubscribeUrl).toContain(`${env.URL}/api/subscriptions.delete`);
expect(unsubscribeUrl).toContain(`userId=${userId}`);
expect(unsubscribeUrl).toContain(`documentId=${documentId}`);
});
});
});