From c1741abc3cbe2c90bce8eb6624d10dc2cf35f774 Mon Sep 17 00:00:00 2001 From: FunJim Date: Fri, 3 Apr 2026 16:57:39 +0800 Subject: [PATCH] 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. --- .../discord/src/monitor/message-handler.process.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/discord/src/monitor/message-handler.process.test.ts b/extensions/discord/src/monitor/message-handler.process.test.ts index 89018c7dfcd..d509832db77 100644 --- a/extensions/discord/src/monitor/message-handler.process.test.ts +++ b/extensions/discord/src/monitor/message-handler.process.test.ts @@ -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 () => {