Open a finished Rule from its Profile card, and drop it from the browser on Log out.
This commit is contained in:
1 parent
db1599123b
commit
942c7cc9de
17 files changed
+280
-14
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user