mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-18 17:57:26 +00:00
perf(test): fold cron webhook schema coverage into config misc
This commit is contained in:
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user