mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-30 23:16:52 +00:00
test(mattermost): add sendMedia threadId fallback test
This commit is contained in:
committed by
Muhammed Mukhthar CM
parent
6c565f88d1
commit
5cc04e2fac
@@ -356,7 +356,7 @@ describe("mattermostPlugin", () => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("uses threadId as fallback when replyToId is absent", async () => {
|
it("uses threadId as fallback when replyToId is absent (sendText)", async () => {
|
||||||
const sendText = mattermostPlugin.outbound?.sendText;
|
const sendText = mattermostPlugin.outbound?.sendText;
|
||||||
if (!sendText) {
|
if (!sendText) {
|
||||||
return;
|
return;
|
||||||
@@ -378,6 +378,30 @@ describe("mattermostPlugin", () => {
|
|||||||
}),
|
}),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("uses threadId as fallback when replyToId is absent (sendMedia)", async () => {
|
||||||
|
const sendMedia = mattermostPlugin.outbound?.sendMedia;
|
||||||
|
if (!sendMedia) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await sendMedia({
|
||||||
|
to: "channel:CHAN1",
|
||||||
|
text: "caption",
|
||||||
|
mediaUrl: "https://example.com/image.png",
|
||||||
|
accountId: "default",
|
||||||
|
threadId: "post-root",
|
||||||
|
} as any);
|
||||||
|
|
||||||
|
expect(sendMessageMattermostMock).toHaveBeenCalledWith(
|
||||||
|
"channel:CHAN1",
|
||||||
|
"caption",
|
||||||
|
expect.objectContaining({
|
||||||
|
accountId: "default",
|
||||||
|
replyToId: "post-root",
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("config", () => {
|
describe("config", () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user