contracts 1.21.0: demo scenarios, eight churches across every product

agent.DEMO_SCENARIOS (one per Website demo profile, each its own fictional
church), DEMO_SCENARIO_ORDER (Accounts first), DEMO_SCENARIO_MIN_VERSIONS,
scenario in seed-demo, accounts in DEMO_PRODUCTS, a profile per scenario for
Events and the App, SEED_SCENARIO_MIN_AGENT (1.7.0).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-30 10:11:46 +02:00
co-authored by Claude Opus 5.5
parent b720706143
commit 7032e16894
9 changed files with 245 additions and 24 deletions
+52 -5
View File
@@ -169,17 +169,64 @@ describe("seed-demo jobs", () => {
expect(args({ church: "hope", product: "website", profile: "bold-plant" })).toBe(true);
expect(args({ church: "hope", product: "events", profile: "small" })).toBe(true);
expect(args({ church: "hope", product: "website", profile: "small" })).toBe(false);
expect(args({ church: "hope", profile: "bold-plant" })).toBe(false);
// 1.21.0: Events has a profile per scenario too, so a scenario name with no product is an Events demo.
expect(args({ church: "hope", profile: "bold-plant" })).toBe(true);
expect(args({ church: "hope", product: "website", profile: "clean-campus", adminEmail: "jane@hope.test" })).toBe(false);
expect(args({ church: "hope", product: "accounts", profile: "small" })).toBe(false);
expect(agent.WEBSITE_DEMO_PROFILES).toHaveLength(8);
});
it("1.20.0: an App demo names the product and takes only an App profile, without an admin email", () => {
expect(agent.DEMO_PRODUCTS).toContain("app");
expect(args({ church: "demo2", product: "app", profile: "acacia-hill" })).toBe(true);
expect(args({ church: "demo2", product: "app", profile: "bold-plant" })).toBe(false);
expect(args({ church: "demo2", profile: "acacia-hill" })).toBe(false);
expect(args({ church: "demo2", product: "app", profile: "acacia-hill", adminEmail: "jane@hope.test" })).toBe(false);
expect(args({ church: "demo2", product: "app", profile: "community-family" })).toBe(true);
expect(args({ church: "demo2", product: "app", profile: "small" })).toBe(false);
expect(args({ church: "demo2", product: "app", profile: "acacia-hill" })).toBe(false);
expect(args({ church: "demo2", product: "app", profile: "community-family", adminEmail: "jane@hope.test" })).toBe(false);
});
});
describe("demo scenarios (1.21.0)", () => {
const args = (a: Record<string, unknown>) => agent.jobArgsSchemas["seed-demo"].safeParse(a).success;
it("has eight, one per Website demo profile, with unique churches", () => {
expect(agent.DEMO_SCENARIOS.map((s) => s.key)).toEqual([...agent.WEBSITE_DEMO_PROFILES]);
expect(new Set(agent.DEMO_SCENARIOS.map((s) => s.church)).size).toBe(8);
});
it("names only profiles each product has", () => {
for (const s of agent.DEMO_SCENARIOS) {
for (const product of agent.DEMO_SCENARIO_ORDER) {
expect(agent.DEMO_PROFILES_BY_PRODUCT[product]).toContain(s.profiles[product]);
}
}
});
it("loads Accounts first, every demo product once, each with a minimum release and agent", () => {
expect(agent.DEMO_SCENARIO_ORDER[0]).toBe("accounts");
expect([...agent.DEMO_SCENARIO_ORDER].sort()).toEqual([...agent.DEMO_PRODUCTS].sort());
for (const p of agent.DEMO_PRODUCTS) {
expect(agent.DEMO_SCENARIO_MIN_VERSIONS[p]).toMatch(/^\d+\.\d+\.\d+$/);
expect(agent.SEED_DEMO_MIN_AGENT_BY_PRODUCT[p]).toMatch(/^\d+\.\d+\.\d+$/);
}
});
it("covers the App's bands from 0–100 to 2 001–5 000", () => {
const bands = new Set(agent.DEMO_SCENARIOS.map((s) => s.appActiveMembers));
for (const b of ["0–100", "101–300", "301–750", "751–2 000", "2 001–5 000"] as const) expect(bands).toContain(b);
});
it("takes a scenario only with that scenario's profile for the product", () => {
expect(args({ church: "demo2", product: "accounts", profile: "clean-campus", scenario: "clean-campus" })).toBe(true);
expect(args({ church: "demo2", profile: "bold-youth", scenario: "bold-youth" })).toBe(true);
expect(args({ church: "demo2", product: "website", profile: "bold-plant", scenario: "bold-youth" })).toBe(false);
expect(args({ church: "demo2", profile: "events", scenario: "bold-youth" })).toBe(false);
expect(args({ church: "demo2", product: "app", profile: "bold-youth", scenario: "nowhere" })).toBe(false);
});
it("keeps Events' four single-product demos, and Accounts takes no admin email or Events profile", () => {
expect(args({ church: "hope", profile: "multicampus" })).toBe(true);
expect(args({ church: "hope", profile: "clean-modern" })).toBe(true);
expect(args({ church: "demo2", product: "accounts", profile: "small" })).toBe(false);
expect(args({ church: "demo2", product: "accounts", profile: "clean-modern", adminEmail: "jane@hope.test" })).toBe(false);
});
});