From e847e0f2ddfecd11a090dec40d6b702aa95131de Mon Sep 17 00:00:00 2001 From: Shakker Date: Tue, 12 May 2026 00:02:26 +0100 Subject: [PATCH] test: specify telegram command menu registrations --- extensions/telegram/src/bot.command-menu.test.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/extensions/telegram/src/bot.command-menu.test.ts b/extensions/telegram/src/bot.command-menu.test.ts index 45f0ebe6239..e40a9234ec2 100644 --- a/extensions/telegram/src/bot.command-menu.test.ts +++ b/extensions/telegram/src/bot.command-menu.test.ts @@ -129,7 +129,11 @@ describe("createTelegramBot command menu", () => { command: normalizeTelegramCommandName(command.name), description: command.description, })); - expect(registered.slice(0, native.length)).toEqual(native); + expect(registered).toStrictEqual([ + ...native, + { command: "custom_backup", description: "Git backup" }, + { command: "custom_generate", description: "Create an image" }, + ]); }); it("ignores custom commands that collide with native commands", async () => { @@ -170,7 +174,7 @@ describe("createTelegramBot command menu", () => { await commandsSynced; - const registered = setMyCommandsSpy.mock.calls[0]?.[0] as Array<{ + const registered = setMyCommandsSpy.mock.calls.at(-1)?.[0] as Array<{ command: string; description: string; }>; @@ -183,7 +187,10 @@ describe("createTelegramBot command menu", () => { if (!nativeStatus) { throw new Error("expected native Telegram status command"); } - expect(registered).toContainEqual({ command: "custom_backup", description: "Git backup" }); + expect(registered).toStrictEqual([ + ...native, + { command: "custom_backup", description: "Git backup" }, + ]); expect(registered).not.toContainEqual({ command: "status", description: "Custom status" }); expect(registered.find((command) => command.command === "status")).toEqual(nativeStatus); expect(countMatching(registered, (command) => command.command === "status")).toBe(1);