mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 09:07:39 +00:00
31 lines
734 B
TypeScript
31 lines
734 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { validateConfigObject } from "./config.js";
|
|
|
|
describe("gateway.tools config", () => {
|
|
it("accepts gateway.tools allow and deny lists", () => {
|
|
const res = validateConfigObject({
|
|
gateway: {
|
|
tools: {
|
|
allow: ["gateway"],
|
|
deny: ["sessions_spawn", "sessions_send"],
|
|
},
|
|
},
|
|
});
|
|
expect(res.ok).toBe(true);
|
|
});
|
|
|
|
it("rejects invalid gateway.tools values", () => {
|
|
const res = validateConfigObject({
|
|
gateway: {
|
|
tools: {
|
|
allow: "gateway",
|
|
},
|
|
},
|
|
});
|
|
expect(res.ok).toBe(false);
|
|
if (!res.ok) {
|
|
expect(res.issues[0]?.path).toBe("gateway.tools.allow");
|
|
}
|
|
});
|
|
});
|