Show invited people the Rule, let them copy its cards for their community, and replace an expired invitation link.
This commit is contained in:
1 parent
727a92a9ac
commit
3c984e00c5
37 files changed
+1962
-19
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
inviteExpiredPath,
|
||||
invitedRulePath,
|
||||
} from "../../lib/create/invitePaths";
|
||||
|
||||
describe("invitedRulePath", () => {
|
||||
it("encodes the rule id", () => {
|
||||
expect(invitedRulePath("ab/c")).toBe("/invite/ab%2Fc");
|
||||
});
|
||||
|
||||
it("appends copy=1", () => {
|
||||
expect(invitedRulePath("rule-1", { copy: true })).toBe(
|
||||
"/invite/rule-1?copy=1",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("inviteExpiredPath", () => {
|
||||
it("omits the token when missing", () => {
|
||||
expect(inviteExpiredPath()).toBe("/invite/expired");
|
||||
});
|
||||
|
||||
it("encodes the token", () => {
|
||||
expect(inviteExpiredPath("a+b")).toBe("/invite/expired?token=a%2Bb");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user