From 1f8d29e532edf3ea6871dcd13acfc6bd60d0903d Mon Sep 17 00:00:00 2001 From: Shakker Date: Mon, 11 May 2026 14:25:18 +0100 Subject: [PATCH] test: pin command registry checks --- src/auto-reply/commands-registry.test.ts | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/auto-reply/commands-registry.test.ts b/src/auto-reply/commands-registry.test.ts index 9262fd4a4ec..152906e3a6b 100644 --- a/src/auto-reply/commands-registry.test.ts +++ b/src/auto-reply/commands-registry.test.ts @@ -480,18 +480,14 @@ describe("commands registry", () => { pinActivePluginChannelRegistry(pinnedEmptyRegistry); setActivePluginRegistry(createNativeCommandsRegistry("discord")); - expect([...commandKeySet(listChatCommands())]).toEqual( - expect.arrayContaining(["dock:discord"]), - ); - expect([...commandKeySet(listChatCommands())]).not.toEqual( - expect.arrayContaining(["dock:slack"]), - ); + const discordCommandKeys = commandKeySet(listChatCommands()); + expect(discordCommandKeys.has("dock:discord")).toBe(true); + expect(discordCommandKeys.has("dock:slack")).toBe(false); setActivePluginRegistry(createNativeCommandsRegistry("slack")); - expect([...commandKeySet(listChatCommands())]).not.toEqual( - expect.arrayContaining(["dock:discord"]), - ); - expect([...commandKeySet(listChatCommands())]).toEqual(expect.arrayContaining(["dock:slack"])); + const slackCommandKeys = commandKeySet(listChatCommands()); + expect(slackCommandKeys.has("dock:discord")).toBe(false); + expect(slackCommandKeys.has("dock:slack")).toBe(true); }); it("refreshes text-command gating when pinned-empty fallback active registry changes", () => { @@ -701,8 +697,10 @@ describe("commands registry args", () => { const seenChoice = requireSeenChoice(seen); expect(seenChoice.commandKey).toBe("think"); expect(seenChoice.argName).toBe("level"); - expect(seenChoice.provider).toEqual(expect.stringMatching(/\S/)); - expect(seenChoice.model).toEqual(expect.stringMatching(/\S/)); + expect(typeof seenChoice.provider).toBe("string"); + expect(seenChoice.provider?.trim().length).toBeGreaterThan(0); + expect(typeof seenChoice.model).toBe("string"); + expect(seenChoice.model?.trim().length).toBeGreaterThan(0); expect(seenChoice.catalogLength).toBe(0); });