mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-06 14:51:08 +00:00
test(discord): update ack reaction assertions to expect propagated cfg
The implementation fix propagates the hydrated cfg to reactMessageDiscord and removeReactionDiscord. Update test assertions to expect the cfg property in the options argument using expect.objectContaining to handle the dynamic session store path.
This commit is contained in:
committed by
Peter Steinberger
parent
b51214ec3e
commit
c1741abc3c
@@ -310,7 +310,7 @@ describe("processDiscordMessage ack reactions", () => {
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
await processDiscordMessage(ctx as any);
|
||||
|
||||
expect(sendMocks.reactMessageDiscord.mock.calls[0]).toEqual(["c1", "m1", "👀", { rest: {} }]);
|
||||
expect(sendMocks.reactMessageDiscord.mock.calls[0]).toEqual(["c1", "m1", "👀", { rest: {}, cfg: expect.objectContaining({ messages: { ackReaction: "👀" } }) }]);
|
||||
});
|
||||
|
||||
it("uses preflight-resolved messageChannelId when message.channelId is missing", async () => {
|
||||
@@ -332,7 +332,7 @@ describe("processDiscordMessage ack reactions", () => {
|
||||
"fallback-channel",
|
||||
"m1",
|
||||
"👀",
|
||||
{ rest: {} },
|
||||
{ rest: {}, cfg: expect.objectContaining({ messages: { ackReaction: "👀" } }) },
|
||||
]);
|
||||
});
|
||||
|
||||
@@ -488,7 +488,7 @@ describe("processDiscordMessage ack reactions", () => {
|
||||
// oxlint-disable-next-line typescript/no-explicit-any
|
||||
await processDiscordMessage(ctx as any);
|
||||
|
||||
expect(sendMocks.removeReactionDiscord).toHaveBeenCalledWith("c1", "m1", "👀", { rest: {} });
|
||||
expect(sendMocks.removeReactionDiscord).toHaveBeenCalledWith("c1", "m1", "👀", expect.objectContaining({ rest: {}, cfg: expect.objectContaining({ messages: expect.objectContaining({ ackReaction: "👀", removeAckAfterReply: true }) }) }));
|
||||
});
|
||||
|
||||
it("removes the plain ack reaction when status reactions are disabled and removeAckAfterReply is enabled", async () => {
|
||||
|
||||
Reference in New Issue
Block a user