diff --git a/src/telegram/bot/helpers.test.ts b/src/telegram/bot/helpers.test.ts index dac5d513e9a..6dd98f5f2f9 100644 --- a/src/telegram/bot/helpers.test.ts +++ b/src/telegram/bot/helpers.test.ts @@ -64,12 +64,6 @@ describe("buildTelegramThreadParams", () => { message_thread_id: 0, }); }); - - it("normalizes thread ids to integers", () => { - expect(buildTelegramThreadParams({ id: 42.9, scope: "forum" })).toEqual({ - message_thread_id: 42, - }); - }); }); describe("buildTypingThreadParams", () => { @@ -80,9 +74,20 @@ describe("buildTypingThreadParams", () => { it("includes General topic thread id for typing indicators", () => { expect(buildTypingThreadParams(1)).toEqual({ message_thread_id: 1 }); }); +}); - it("normalizes thread ids to integers", () => { - expect(buildTypingThreadParams(42.9)).toEqual({ message_thread_id: 42 }); +describe("thread id normalization", () => { + it.each([ + { + build: () => buildTelegramThreadParams({ id: 42.9, scope: "forum" }), + expected: { message_thread_id: 42 }, + }, + { + build: () => buildTypingThreadParams(42.9), + expected: { message_thread_id: 42 }, + }, + ])("normalizes thread ids to integers", ({ build, expected }) => { + expect(build()).toEqual(expected); }); });