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.
37 lines
1.1 KiB
TypeScript
37 lines
1.1 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import {
|
|
publishedRuleAnalyticsFromDocument,
|
|
publishedRuleAnalyticsFromState,
|
|
} from "../../lib/create/publishedRuleAnalytics";
|
|
|
|
describe("publishedRuleAnalyticsFromDocument", () => {
|
|
it("reads place and a canonical group type", () => {
|
|
expect(
|
|
publishedRuleAnalyticsFromDocument({
|
|
communityLocation: " Boulder ",
|
|
orgType: "mutualAid",
|
|
}),
|
|
).toEqual({ communityLocation: "Boulder", orgType: "mutualAid" });
|
|
});
|
|
|
|
it("drops unknown types and empty place", () => {
|
|
expect(
|
|
publishedRuleAnalyticsFromDocument({
|
|
communityLocation: " ",
|
|
orgType: "not-a-kind",
|
|
}),
|
|
).toEqual({ communityLocation: null, orgType: null });
|
|
});
|
|
});
|
|
|
|
describe("publishedRuleAnalyticsFromState", () => {
|
|
it("takes place from the description field and the main group type", () => {
|
|
expect(
|
|
publishedRuleAnalyticsFromState({
|
|
communityLocation: "Denver",
|
|
selectedOrganizationTypeIds: ["mutualAid", "nonprofit"],
|
|
}),
|
|
).toEqual({ communityLocation: "Denver", orgType: "mutualAid" });
|
|
});
|
|
});
|