Files
openclaw/src/config/zod-schema.signal-groups.test.ts
Alex Zaytsev 61429230b2 fix(signal): add groups config to Signal channel schema (#27199)
Merged via squash.

Prepared head SHA: 4ba4a39ddf
Co-authored-by: unisone <32521398+unisone@users.noreply.github.com>
Co-authored-by: altaywtf <9790196+altaywtf@users.noreply.github.com>
Reviewed-by: @altaywtf
2026-03-13 15:14:30 +03:00

66 lines
1.4 KiB
TypeScript

import { describe, expect, it } from "vitest";
import { validateConfigObject } from "./config.js";
describe("signal groups schema", () => {
it("accepts top-level Signal groups overrides", () => {
const res = validateConfigObject({
channels: {
signal: {
groups: {
"*": {
requireMention: false,
},
"+1234567890": {
requireMention: true,
},
},
},
},
});
expect(res.ok).toBe(true);
});
it("accepts per-account Signal groups overrides", () => {
const res = validateConfigObject({
channels: {
signal: {
accounts: {
primary: {
groups: {
"*": {
requireMention: false,
},
},
},
},
},
},
});
expect(res.ok).toBe(true);
});
it("rejects unknown keys in Signal groups entries", () => {
const res = validateConfigObject({
channels: {
signal: {
groups: {
"*": {
requireMention: false,
nope: true,
},
},
},
},
});
expect(res.ok).toBe(false);
if (!res.ok) {
expect(res.issues.some((issue) => issue.path.startsWith("channels.signal.groups"))).toBe(
true,
);
}
});
});