mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-26 00:23:33 +00:00
test(feishu): add regression for audio download resource type=file (openclaw#16311) thanks @Yaxuan42
Verified: - pnpm build - pnpm check - pnpm vitest run --config vitest.extensions.config.ts extensions/feishu/src/bot.test.ts extensions/feishu/src/media.test.ts Co-authored-by: Yaxuan42 <184813557+Yaxuan42@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import type { ClawdbotConfig, PluginRuntime, RuntimeEnv } from "openclaw/plugin-sdk";
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import type { FeishuMessageEvent } from "./bot.js";
|
||||
import { buildFeishuAgentBody, handleFeishuMessage } from "./bot.js";
|
||||
import { buildFeishuAgentBody, handleFeishuMessage, toMessageResourceType } from "./bot.js";
|
||||
import { setFeishuRuntime } from "./runtime.js";
|
||||
|
||||
const {
|
||||
@@ -993,3 +993,19 @@ describe("handleFeishuMessage command authorization", () => {
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("toMessageResourceType", () => {
|
||||
it("maps image to image", () => {
|
||||
expect(toMessageResourceType("image")).toBe("image");
|
||||
});
|
||||
|
||||
it("maps audio to file", () => {
|
||||
expect(toMessageResourceType("audio")).toBe("file");
|
||||
});
|
||||
|
||||
it("maps video/file/sticker to file", () => {
|
||||
expect(toMessageResourceType("video")).toBe("file");
|
||||
expect(toMessageResourceType("file")).toBe("file");
|
||||
expect(toMessageResourceType("sticker")).toBe("file");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user