test: tighten discord native command context assertions · openclaw/openclaw@3066602
shakkernerd
·
2026-05-11
·
via Recent Commits to openclaw:main
File tree
extensions/discord/src/monitor
| Original file line number | Diff line number | Diff line change |
|---|
@@ -90,9 +90,11 @@ describe("buildDiscordNativeCommandContext", () => {
|
90 | 90 | expect(ctx.MessageThreadId).toBe("chan-1"); |
91 | 91 | expect(ctx.ThreadParentId).toBe("parent-1"); |
92 | 92 | expect(ctx.OriginatingTo).toBe("channel:chan-1"); |
93 | | -expect(ctx.UntrustedContext).toEqual([ |
94 | | -expect.stringContaining("Discord channel topic:\nProduction alerts only"), |
95 | | -]); |
| 93 | +expect(ctx.UntrustedContext).toHaveLength(1); |
| 94 | +const [untrustedContext] = ctx.UntrustedContext ?? []; |
| 95 | +expect(untrustedContext).toContain("Source: Channel metadata"); |
| 96 | +expect(untrustedContext).toContain("UNTRUSTED channel metadata (discord)"); |
| 97 | +expect(untrustedContext).toContain("Discord channel topic:\nProduction alerts only"); |
96 | 98 | expect(ctx.Timestamp).toBe(456); |
97 | 99 | }); |
98 | 100 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。