From ef99cc670e083c2f4b67d71891c4fe59f5b5d7d5 Mon Sep 17 00:00:00 2001 From: Shakker Date: Tue, 12 May 2026 05:25:02 +0100 Subject: [PATCH] test: check scoped command secret targets --- src/cli/command-secret-targets.test.ts | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/cli/command-secret-targets.test.ts b/src/cli/command-secret-targets.test.ts index a2812b12b41..934db65649c 100644 --- a/src/cli/command-secret-targets.test.ts +++ b/src/cli/command-secret-targets.test.ts @@ -103,10 +103,13 @@ describe("command secret target ids", () => { channel: "discord", }); - expect(scoped.targetIds.size).toBeGreaterThan(0); - const targetIds = [...scoped.targetIds]; - expect(targetIds.every((id) => id.startsWith("channels.discord."))).toBe(true); - expect(targetIds.some((id) => id.startsWith("channels.telegram."))).toBe(false); + expect(scoped.targetIds).toEqual( + new Set([ + "channels.discord.accounts.chat.token", + "channels.discord.accounts.ops.token", + "channels.discord.token", + ]), + ); }); it("does not coerce missing accountId to default when channel is scoped", () => { @@ -127,8 +130,13 @@ describe("command secret target ids", () => { }); expect(scoped.allowedPaths).toBeUndefined(); - expect(scoped.targetIds.size).toBeGreaterThan(0); - expect([...scoped.targetIds].every((id) => id.startsWith("channels.discord."))).toBe(true); + expect(scoped.targetIds).toEqual( + new Set([ + "channels.discord.accounts.chat.token", + "channels.discord.accounts.ops.token", + "channels.discord.token", + ]), + ); }); it("scopes allowed paths to channel globals + selected account", () => {