test: tighten security fix account assertion · openclaw/openclaw@78bbbde
shakkernerd
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -122,7 +122,12 @@ describe("security fix", () => {
|
122 | 122 | ) => { |
123 | 123 | const whatsapp = channels.whatsapp; |
124 | 124 | const accounts = whatsapp.accounts as Record<string, Record<string, unknown>>; |
125 | | -expect(accounts[accountId]?.groupPolicy).toBe(expectedPolicy); |
| 125 | +const account = accounts[accountId]; |
| 126 | +expect(account).toBeDefined(); |
| 127 | +if (!account) { |
| 128 | +throw new Error(`Expected WhatsApp account ${accountId}`); |
| 129 | +} |
| 130 | +expect(account.groupPolicy).toBe(expectedPolicy); |
126 | 131 | return accounts; |
127 | 132 | }; |
128 | 133 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。