Open a finished Rule from its Profile card, and drop it from the browser on Log out.

This commit is contained in:
adilallo committed 2026-11-22 17:47:46 -07:00
1 parent db1599123b
commit 942c7cc9de
17 files changed
+280 -14

No files matched your search

+16
View File
@@ -35,6 +35,7 @@ vi.mock("../../lib/logger", () => ({
import {
claimGuestRulesForUser,
clearGuestRuleClaimCookie,
issueGuestRuleClaimCookie,
} from "../../lib/server/guestRuleClaim";
@@ -76,6 +77,21 @@ describe("issueGuestRuleClaimCookie", () => {
});
});
describe("clearGuestRuleClaimCookie", () => {
it("expires the claim cookie", async () => {
await clearGuestRuleClaimCookie();
expect(cookieSetMock).toHaveBeenCalledWith(
"cr_rule_claim",
"",
expect.objectContaining({
httpOnly: true,
path: "/",
maxAge: 0,
}),
);
});
});
describe("claimGuestRulesForUser", () => {
it("returns 0 when the cookie is empty", async () => {
cookieGetMock.mockReturnValue(undefined);