perf(test): fold cron webhook schema coverage into config misc

This commit is contained in:
Peter Steinberger
2026-02-16 00:28:26 +00:00
parent 04004c5663
commit 056070c2bf
2 changed files with 24 additions and 26 deletions

View File

@@ -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);
});
});

View File

@@ -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);
});
});