fix: add gif playback for WhatsApp sends

This commit is contained in:
Peter Steinberger
2026-01-03 23:56:36 +00:00
parent e1dd764504
commit e17c038d18
13 changed files with 122 additions and 4 deletions

View File

@@ -78,6 +78,27 @@ describe("web outbound", () => {
);
});
it("marks gif playback for video when requested", async () => {
const buf = Buffer.from("gifvid");
loadWebMediaMock.mockResolvedValueOnce({
buffer: buf,
contentType: "video/mp4",
kind: "video",
});
await sendMessageWhatsApp("+1555", "gif", {
verbose: false,
mediaUrl: "/tmp/anim.mp4",
gifPlayback: true,
});
expect(sendMessage).toHaveBeenLastCalledWith(
"+1555",
"gif",
buf,
"video/mp4",
{ gifPlayback: true },
);
});
it("maps image with caption", async () => {
const buf = Buffer.from("img");
loadWebMediaMock.mockResolvedValueOnce({