mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-28 13:58:38 +00:00
feat(feishu): add replyInThread configuration for message replies (openclaw#27325) thanks @kcinzgg
Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: kcinzgg <13964709+kcinzgg@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { FeishuConfigSchema } from "./config-schema.js";
|
||||
import { FeishuConfigSchema, FeishuGroupSchema } from "./config-schema.js";
|
||||
|
||||
describe("FeishuConfigSchema webhook validation", () => {
|
||||
it("applies top-level defaults", () => {
|
||||
@@ -86,3 +86,34 @@ describe("FeishuConfigSchema webhook validation", () => {
|
||||
expect(result.success).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("FeishuConfigSchema replyInThread", () => {
|
||||
it("accepts replyInThread at top level", () => {
|
||||
const result = FeishuConfigSchema.parse({ replyInThread: "enabled" });
|
||||
expect(result.replyInThread).toBe("enabled");
|
||||
});
|
||||
|
||||
it("defaults replyInThread to undefined when not set", () => {
|
||||
const result = FeishuConfigSchema.parse({});
|
||||
expect(result.replyInThread).toBeUndefined();
|
||||
});
|
||||
|
||||
it("rejects invalid replyInThread value", () => {
|
||||
const result = FeishuConfigSchema.safeParse({ replyInThread: "always" });
|
||||
expect(result.success).toBe(false);
|
||||
});
|
||||
|
||||
it("accepts replyInThread in group config", () => {
|
||||
const result = FeishuGroupSchema.parse({ replyInThread: "enabled" });
|
||||
expect(result.replyInThread).toBe("enabled");
|
||||
});
|
||||
|
||||
it("accepts replyInThread in account config", () => {
|
||||
const result = FeishuConfigSchema.parse({
|
||||
accounts: {
|
||||
main: { replyInThread: "enabled" },
|
||||
},
|
||||
});
|
||||
expect(result.accounts?.main?.replyInThread).toBe("enabled");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user