refactor(feishu): remove unused send test fixtures (#160913)

Co-authored-by: Vincent Koc <vincentkoc@ieee.org>
This commit is contained in:
Vincent Koc 2026-09-29 10:22:47 +07:00 • committed by GitHub
parent 59490dc752
commit b9dde661a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 0 additions and 45 deletions

View file

@ -33,17 +33,6 @@ vi.mock("openclaw/plugin-sdk/text-chunking", async (importOriginal) => {
const actual = await importOriginal<typeof import("openclaw/plugin-sdk/text-chunking")>();
return { ...actual, convertMarkdownTables: mockConvertMarkdownTables };
});
vi.mock("./runtime.js", () => ({
getFeishuRuntime: () => ({
channel: {
text: {
resolveMarkdownTableMode: vi.fn(() => "preserve"),
convertMarkdownTables: vi.fn((text: string) => text),
},
},
}),
}));
let sendMessageFeishu: typeof import("./send.js").sendMessageFeishu;
const cfg = {} as ClawdbotConfig;

View file

@ -3,25 +3,11 @@ import { isChannelPartialDeliveryError } from "openclaw/plugin-sdk/channel-inbou
import { afterAll, beforeAll, beforeEach, describe, expect, it, vi } from "vitest";
const resolveFeishuSendTargetMock = vi.hoisted(() => vi.fn());
const resolveMarkdownTableModeMock = vi.hoisted(() => vi.fn(() => "preserve"));
const convertMarkdownTablesMock = vi.hoisted(() => vi.fn((text: string) => text));
vi.mock("./send-target.js", () => ({
resolveFeishuSendTarget: resolveFeishuSendTargetMock,
}));
vi.mock("./runtime.js", () => ({
setFeishuRuntime: vi.fn(),
getFeishuRuntime: () => ({
channel: {
text: {
resolveMarkdownTableMode: resolveMarkdownTableModeMock,
convertMarkdownTables: convertMarkdownTablesMock,
},
},
}),
}));
let sendCardFeishu: typeof import("./send.js").sendCardFeishu;
let sendMessageFeishu: typeof import("./send.js").sendMessageFeishu;
@ -46,7 +32,6 @@ describe("Feishu reply fallback for withdrawn/deleted targets", () => {
afterAll(() => {
vi.doUnmock("./send-target.js");
vi.doUnmock("./runtime.js");
vi.resetModules();
});

View file

@ -752,25 +752,6 @@ describe("editMessageFeishu", () => {
expect(mockClientUpdate).not.toHaveBeenCalled();
});
it("patches interactive content for card edits", async () => {
mockClientPatch.mockResolvedValueOnce({ code: 0 });
const result = await editMessageFeishu({
cfg: {} as ClawdbotConfig,
messageId: "om_card",
card: { schema: "2.0" },
});
expect(mockClientPatch).toHaveBeenCalledWith({
path: { message_id: "om_card" },
data: {
content: JSON.stringify({ schema: "2.0" }),
},
});
expect(mockClientUpdate).not.toHaveBeenCalled();
expect(result).toEqual({ messageId: "om_card", contentType: "interactive" });
});
it.each([
{ name: "rich-post", body: { text: "updated body" }, request: mockClientUpdate },
{ name: "interactive-card", body: { card: { schema: "2.0" } }, request: mockClientPatch },