diff --git a/src/config/config-misc.test.ts b/src/config/config-misc.test.ts index e3853666889..54caaf7fdcf 100644 --- a/src/config/config-misc.test.ts +++ b/src/config/config-misc.test.ts @@ -87,3 +87,27 @@ describe("talk.voiceAliases", () => { expect(res.ok).toBe(false); }); }); + +describe("cron webhook schema", () => { + it("accepts cron.webhook and cron.webhookToken", () => { + const res = OpenClawSchema.safeParse({ + cron: { + enabled: true, + webhook: "https://example.invalid/cron", + webhookToken: "secret-token", + }, + }); + + expect(res.success).toBe(true); + }); + + it("rejects non-http(s) cron.webhook URLs", () => { + const res = OpenClawSchema.safeParse({ + cron: { + webhook: "ftp://example.invalid/cron", + }, + }); + + expect(res.success).toBe(false); + }); +}); diff --git a/src/config/config.cron-webhook-schema.test.ts b/src/config/config.cron-webhook-schema.test.ts deleted file mode 100644 index e6f64bf5890..00000000000 --- a/src/config/config.cron-webhook-schema.test.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { describe, expect, it } from "vitest"; -import { OpenClawSchema } from "./zod-schema.js"; - -describe("cron webhook schema", () => { - it("accepts cron.webhook and cron.webhookToken", () => { - const res = OpenClawSchema.safeParse({ - cron: { - enabled: true, - webhook: "https://example.invalid/cron", - webhookToken: "secret-token", - }, - }); - - expect(res.success).toBe(true); - }); - - it("rejects non-http(s) cron.webhook URLs", () => { - const res = OpenClawSchema.safeParse({ - cron: { - webhook: "ftp://example.invalid/cron", - }, - }); - - expect(res.success).toBe(false); - }); -});