Send the invitation as a light letter that names the community, the inviter by email, and who can read the Rule.

This commit is contained in:
adilallo committed 2026-11-06 09:00:44 -07:00
1 parent 70ceb73104
commit 727a92a9ac
14 files changed
+534 -26

No files matched your search

@@ -130,7 +130,13 @@ describe("POST /api/rules/[id]/stakeholders", () => {
routeCtx,
);
expect(res.status).toBe(201);
expect(createInviteMock).toHaveBeenCalled();
expect(createInviteMock).toHaveBeenCalledWith(
expect.objectContaining({
email: "inv@example.com",
ruleTitle: "My rule",
inviterEmail: owner.email,
}),
);
const body = (await res.json()) as {
stakeholder: { email: string; status: string };
};
@@ -214,9 +220,14 @@ describe("POST /api/rules/[id]/stakeholders/[stakeholderId]/resend", () => {
expect(await res.json()).toEqual({ ok: true });
expect(updateMock).toHaveBeenCalled();
expect(sendInviteEmailMock).toHaveBeenCalledWith(
"inv@example.com",
expect.stringContaining("/api/invites/rule-stakeholder/verify?token="),
"My rule",
expect.objectContaining({
to: "inv@example.com",
communityName: "My rule",
inviterEmail: owner.email,
verifyUrl: expect.stringContaining(
"/api/invites/rule-stakeholder/verify?token=",
),
}),
);
});
});