Demo data from the Hub: crosscode demo, the seed-demo job, set-demo fixes
- scripts: `crosscode demo <church> --profile … [--admin-email …]`: backup, set-demo.js as the site's user, reload, wait for /health. - Contracts 1.7.0: the seed-demo job, DEMO_PROFILES, SEED_DEMO_MIN_AGENT. - Agent 1.2.0: seed-demo → crosscode demo. - Events 2.4.1: set-demo.js stops with a clear message when it can't read .env (was "client password must be a string", then a hang); keeps the oldest admin when the default one isn't on the site; --admin-email=. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -154,6 +154,19 @@ describe("exports", () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe("seed-demo jobs", () => {
|
||||
const args = (a: Record<string, unknown>) => agent.jobArgsSchemas["seed-demo"].safeParse(a).success;
|
||||
it("take a known profile, and an admin email only when it is one", () => {
|
||||
expect(args({ church: "hope", profile: "ministry" })).toBe(true);
|
||||
expect(args({ church: "hope", profile: "events", adminEmail: "jane@hope.test" })).toBe(true);
|
||||
expect(args({ church: "hope", profile: "everything" })).toBe(false);
|
||||
expect(args({ church: "hope", profile: "small", adminEmail: "not an email; rm -rf /" })).toBe(false);
|
||||
expect(args({ church: "hope", profile: "small", extra: 1 })).toBe(false);
|
||||
expect(agent.JOB_TYPES).toContain("seed-demo");
|
||||
expect(agent.CENTRAL_JOB_TYPES).not.toContain("seed-demo");
|
||||
});
|
||||
});
|
||||
|
||||
describe("env templates", () => {
|
||||
it("lists the required server and defaults values that are missing", () => {
|
||||
const template = agent.envTemplateSchema.parse({
|
||||
|
||||
Reference in New Issue
Block a user