test: check scoped command secret targets · openclaw/openclaw@ef99cc6
shakkernerd
·
2026-05-12
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -103,10 +103,13 @@ describe("command secret target ids", () => {
|
103 | 103 | channel: "discord", |
104 | 104 | }); |
105 | 105 | |
106 | | -expect(scoped.targetIds.size).toBeGreaterThan(0); |
107 | | -const targetIds = [...scoped.targetIds]; |
108 | | -expect(targetIds.every((id) => id.startsWith("channels.discord."))).toBe(true); |
109 | | -expect(targetIds.some((id) => id.startsWith("channels.telegram."))).toBe(false); |
| 106 | +expect(scoped.targetIds).toEqual( |
| 107 | +new Set([ |
| 108 | +"channels.discord.accounts.chat.token", |
| 109 | +"channels.discord.accounts.ops.token", |
| 110 | +"channels.discord.token", |
| 111 | +]), |
| 112 | +); |
110 | 113 | }); |
111 | 114 | |
112 | 115 | it("does not coerce missing accountId to default when channel is scoped", () => { |
@@ -127,8 +130,13 @@ describe("command secret target ids", () => {
|
127 | 130 | }); |
128 | 131 | |
129 | 132 | expect(scoped.allowedPaths).toBeUndefined(); |
130 | | -expect(scoped.targetIds.size).toBeGreaterThan(0); |
131 | | -expect([...scoped.targetIds].every((id) => id.startsWith("channels.discord."))).toBe(true); |
| 133 | +expect(scoped.targetIds).toEqual( |
| 134 | +new Set([ |
| 135 | +"channels.discord.accounts.chat.token", |
| 136 | +"channels.discord.accounts.ops.token", |
| 137 | +"channels.discord.token", |
| 138 | +]), |
| 139 | +); |
132 | 140 | }); |
133 | 141 | |
134 | 142 | it("scopes allowed paths to channel globals + selected account", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。