mirror of https://github.com/openclaw/openclaw.git
test(mattermost): add sendMedia threadId fallback test
This commit is contained in:
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;
|
||||
if (!sendText) {
|
||||
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", () => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue