mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 19:20:43 +00:00
test(extensions): move legacy schema assertions
This commit is contained in:
@@ -15,6 +15,28 @@ function expectSlackConfigIssue(config: unknown, path: string) {
|
||||
}
|
||||
|
||||
describe("slack config schema", () => {
|
||||
it("defaults groupPolicy to allowlist", () => {
|
||||
const res = SlackConfigSchema.safeParse({});
|
||||
|
||||
expect(res.success).toBe(true);
|
||||
if (res.success) {
|
||||
expect(res.data.groupPolicy).toBe("allowlist");
|
||||
}
|
||||
});
|
||||
|
||||
it("accepts historyLimit overrides per account", () => {
|
||||
const res = SlackConfigSchema.safeParse({
|
||||
historyLimit: 7,
|
||||
accounts: { ops: { historyLimit: 2 } },
|
||||
});
|
||||
|
||||
expect(res.success).toBe(true);
|
||||
if (res.success) {
|
||||
expect(res.data.historyLimit).toBe(7);
|
||||
expect(res.data.accounts?.ops?.historyLimit).toBe(2);
|
||||
}
|
||||
});
|
||||
|
||||
it('rejects dmPolicy="open" without allowFrom "*"', () => {
|
||||
expectSlackConfigIssue(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user