diff --git a/src/auto-reply/reply/reply-flow.test.ts b/src/auto-reply/reply/reply-flow.test.ts index 9eed58d5562..3f79e3e6803 100644 --- a/src/auto-reply/reply/reply-flow.test.ts +++ b/src/auto-reply/reply/reply-flow.test.ts @@ -415,6 +415,7 @@ describe("parseLineDirectives", () => { expectedAltText: "🎵 Bohemian Rhapsody - Queen", expectedText: "Now playing:", expectFooter: true, + expectBodyContents: false, }, { name: "minimal", @@ -422,6 +423,7 @@ describe("parseLineDirectives", () => { expectedAltText: "🎵 Unknown Track", expectedText: undefined, expectFooter: false, + expectBodyContents: false, }, { name: "paused status", diff --git a/src/config/redact-snapshot.test.ts b/src/config/redact-snapshot.test.ts index 627fcd94584..96e98bf3b9d 100644 --- a/src/config/redact-snapshot.test.ts +++ b/src/config/redact-snapshot.test.ts @@ -411,14 +411,16 @@ describe("redactConfigSnapshot", () => { const cfg = redacted as Record>; const cfgCustom2 = cfg.custom2 as unknown as unknown[]; expect(cfgCustom2.length).toBeGreaterThan(0); - expect((cfg.custom1.anykey as Record).mySecret).toBe(REDACTED_SENTINEL); + expect( + ((cfg.custom1 as Record).anykey as Record).mySecret, + ).toBe(REDACTED_SENTINEL); expect((cfgCustom2[0] as Record).mySecret).toBe(REDACTED_SENTINEL); const out = restored as Record>; const outCustom2 = out.custom2 as unknown as unknown[]; expect(outCustom2.length).toBeGreaterThan(0); - expect((out.custom1.anykey as Record).mySecret).toBe( - "this-is-a-custom-secret-value", - ); + expect( + ((out.custom1 as Record).anykey as Record).mySecret, + ).toBe("this-is-a-custom-secret-value"); expect((outCustom2[0] as Record).mySecret).toBe( "this-is-a-custom-secret-value", ); @@ -438,14 +440,16 @@ describe("redactConfigSnapshot", () => { const cfg = redacted as Record>; const cfgCustom2 = cfg.custom2 as unknown as unknown[]; expect(cfgCustom2.length).toBeGreaterThan(0); - expect((cfg.custom1.anykey as Record).mySecret).toBe(REDACTED_SENTINEL); + expect( + ((cfg.custom1 as Record).anykey as Record).mySecret, + ).toBe(REDACTED_SENTINEL); expect((cfgCustom2[0] as Record).mySecret).toBe(REDACTED_SENTINEL); const out = restored as Record>; const outCustom2 = out.custom2 as unknown as unknown[]; expect(outCustom2.length).toBeGreaterThan(0); - expect((out.custom1.anykey as Record).mySecret).toBe( - "this-is-a-custom-secret-value", - ); + expect( + ((out.custom1 as Record).anykey as Record).mySecret, + ).toBe("this-is-a-custom-secret-value"); expect((outCustom2[0] as Record).mySecret).toBe( "this-is-a-custom-secret-value", ); diff --git a/src/discord/monitor.test.ts b/src/discord/monitor.test.ts index 4333a2e6d73..21057369b95 100644 --- a/src/discord/monitor.test.ts +++ b/src/discord/monitor.test.ts @@ -724,9 +724,13 @@ describe("discord reaction notification gating", () => { ] as const; for (const testCase of cases) { - expect(shouldEmitDiscordReactionNotification(testCase.input), testCase.name).toBe( - testCase.expected, - ); + expect( + shouldEmitDiscordReactionNotification({ + ...testCase.input, + allowlist: testCase.input.allowlist ? [...testCase.input.allowlist] : undefined, + }), + testCase.name, + ).toBe(testCase.expected); } }); }); @@ -1040,7 +1044,7 @@ describe("discord reaction notification modes", () => { const guildEntries = makeEntries({ [guildId]: { reactionNotifications: testCase.reactionNotifications, - users: testCase.users, + users: testCase.users ? [...testCase.users] : undefined, }, }); const listener = new DiscordReactionListener(makeReactionListenerParams({ guildEntries })); diff --git a/src/infra/outbound/outbound.test.ts b/src/infra/outbound/outbound.test.ts index 3eb0fd01fb5..56cff3ca265 100644 --- a/src/infra/outbound/outbound.test.ts +++ b/src/infra/outbound/outbound.test.ts @@ -847,7 +847,9 @@ describe("normalizeOutboundPayloadsForJson", () => { ]; for (const testCase of cases) { - expect(normalizeOutboundPayloadsForJson(testCase.input)).toEqual(testCase.expected); + expect( + normalizeOutboundPayloadsForJson(testCase.input.map((payload) => ({ ...payload }))), + ).toEqual(testCase.expected); } }); }); @@ -882,7 +884,13 @@ describe("formatOutboundPayloadLog", () => { ]; for (const testCase of cases) { - expect(formatOutboundPayloadLog(testCase.input), testCase.name).toBe(testCase.expected); + expect( + formatOutboundPayloadLog({ + ...testCase.input, + mediaUrls: [...testCase.input.mediaUrls], + }), + testCase.name, + ).toBe(testCase.expected); } }); }); diff --git a/src/telegram/send.test.ts b/src/telegram/send.test.ts index 62ec6054f77..2ef6df9a708 100644 --- a/src/telegram/send.test.ts +++ b/src/telegram/send.test.ts @@ -595,13 +595,18 @@ describe("sendMessageTelegram", () => { fileName: "video.mp4", }); - await sendMessageTelegram(chatId, testCase.text, { + const opts = { token: "tok", api, mediaUrl: "https://example.com/video.mp4", asVideoNote: true, ...testCase.options, - }); + }; + if (opts.buttons) { + opts.buttons = opts.buttons.map((row) => [...row]); + } + + await sendMessageTelegram(chatId, testCase.text, opts); expect(sendVideoNote).toHaveBeenCalledWith( chatId,