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:
FunJim 2026-04-03 16:57:39 +08:00 committed by Peter Steinberger
parent b51214ec3e
commit c1741abc3c
1 changed files with 3 additions and 3 deletions

View File

@ -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 () => {