Export is PDF, RULE.md, and Print on US Letter, with every shared term, no member names, and a takeaway that points at Ask an organizer. Finished Rules keep type and place so the team can read folded counts without a database, Umami can sit beside the app with no cookies, and the person who holds the pen gets working PDF and RULE.md links 48 hours later.
17 lines
657 B
TypeScript
17 lines
657 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import {
|
|
ruleExportToken,
|
|
ruleExportTokenMatches,
|
|
} from "../../lib/server/ruleExportToken";
|
|
|
|
describe("ruleExportToken", () => {
|
|
it("accepts the matching token and rejects another rule or token", () => {
|
|
const pepper = "test-pepper-16chars";
|
|
const token = ruleExportToken("rule-1", pepper);
|
|
expect(ruleExportTokenMatches("rule-1", token, pepper)).toBe(true);
|
|
expect(ruleExportTokenMatches("rule-2", token, pepper)).toBe(false);
|
|
expect(ruleExportTokenMatches("rule-1", `${token}x`, pepper)).toBe(false);
|
|
expect(ruleExportTokenMatches("rule-1", "", pepper)).toBe(false);
|
|
});
|
|
});
|