test: tighten zalouser setup assertions · openclaw/openclaw@076526b
shakkernerd
·
2026-05-09
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -32,10 +32,20 @@ describe("zalouser setup wizard", () => {
|
32 | 32 | dmPolicy?: "pairing" | "allowlist", |
33 | 33 | ) { |
34 | 34 | expect(result.accountId).toBe("default"); |
35 | | -expect(result.cfg.channels?.zalouser?.enabled).toBe(true); |
36 | | -expect(result.cfg.plugins?.entries?.zalouser?.enabled).toBe(true); |
| 35 | +const channelConfig = result.cfg.channels?.zalouser; |
| 36 | +expect(channelConfig).toBeDefined(); |
| 37 | +if (!channelConfig) { |
| 38 | +throw new Error("expected Zalo Personal channel config"); |
| 39 | +} |
| 40 | +const pluginEntry = result.cfg.plugins?.entries?.zalouser; |
| 41 | +expect(pluginEntry).toBeDefined(); |
| 42 | +if (!pluginEntry) { |
| 43 | +throw new Error("expected Zalo Personal plugin entry"); |
| 44 | +} |
| 45 | +expect(channelConfig.enabled).toBe(true); |
| 46 | +expect(pluginEntry.enabled).toBe(true); |
37 | 47 | if (dmPolicy) { |
38 | | -expect(result.cfg.channels?.zalouser?.dmPolicy).toBe(dmPolicy); |
| 48 | +expect(channelConfig.dmPolicy).toBe(dmPolicy); |
39 | 49 | } |
40 | 50 | } |
41 | 51 | |
@@ -98,9 +108,7 @@ describe("zalouser setup wizard", () => {
|
98 | 108 | |
99 | 109 | const result = await runSetup({ prompter }); |
100 | 110 | |
101 | | -expect(result.accountId).toBe("default"); |
102 | | -expect(result.cfg.channels?.zalouser?.enabled).toBe(true); |
103 | | -expect(result.cfg.plugins?.entries?.zalouser?.enabled).toBe(true); |
| 111 | +expectEnabledDefaultSetup(result); |
104 | 112 | }); |
105 | 113 | |
106 | 114 | it("prompts DM policy before group access in quickstart", async () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。