fix: add caf audio extension regression coverage (#10982) (thanks @succ985)

This commit is contained in:
Gustavo Madeira Santana
2026-02-07 17:56:35 -05:00
parent 2ea6bbfbf5
commit 67fc118185
2 changed files with 16 additions and 1 deletions

View File

@@ -29,6 +29,7 @@ Docs: https://docs.openclaw.ai
- Cron: scheduler reliability (timer drift, restart catch-up, lock contention, stale running markers). (#10776) Thanks @tyler6204.
- Cron: store migration hardening (legacy field migration, parse error handling, explicit delivery mode persistence). (#10776) Thanks @tyler6204.
- Memory: set Voyage embeddings `input_type` for improved retrieval. (#10818) Thanks @mcinteerj.
- Media understanding: recognize `.caf` audio attachments for transcription. (#10982) Thanks @succ985.
- Telegram: auto-inject DM topic threadId in message tool + subagent announce. (#7235) Thanks @Lukavyi.
- Security: require auth for Gateway canvas host and A2UI assets. (#9518) Thanks @coygeek.
- Cron: fix scheduling and reminder delivery regressions; harden next-run recompute + timer re-arming + legacy schedule fields. (#9733, #9823, #9948, #9932) Thanks @tyler6204, @pycckuu, @j2h4u, @fujiwara-tofu-shop.

View File

@@ -1,6 +1,6 @@
import JSZip from "jszip";
import { describe, expect, it } from "vitest";
import { detectMime, extensionForMime, imageMimeFromFormat } from "./mime.js";
import { detectMime, extensionForMime, imageMimeFromFormat, isAudioFileName } from "./mime.js";
async function makeOoxmlZip(opts: { mainMime: string; partPath: string }): Promise<Buffer> {
const zip = new JSZip();
@@ -96,3 +96,17 @@ describe("extensionForMime", () => {
expect(extensionForMime(undefined)).toBeUndefined();
});
});
describe("isAudioFileName", () => {
it("matches known audio extensions", () => {
const cases = [
{ fileName: "voice.mp3", expected: true },
{ fileName: "voice.caf", expected: true },
{ fileName: "voice.bin", expected: false },
] as const;
for (const testCase of cases) {
expect(isAudioFileName(testCase.fileName)).toBe(testCase.expected);
}
});
});