test: tighten discord directory live assertions · openclaw/openclaw@29cdea7
shakkernerd
·
2026-05-11
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -81,8 +81,20 @@ describe("discord directory live lookups", () => {
|
81 | 81 | const rows = await listDiscordDirectoryGroupsLive(makeParams({ query: "an", limit: 2 })); |
82 | 82 | |
83 | 83 | expect(rows).toEqual([ |
84 | | -expect.objectContaining({ kind: "group", id: "channel:c2", name: "random" }), |
85 | | -expect.objectContaining({ kind: "group", id: "channel:c3", name: "announcements" }), |
| 84 | +{ |
| 85 | +kind: "group", |
| 86 | +id: "channel:c2", |
| 87 | +name: "random", |
| 88 | +handle: "#random", |
| 89 | +raw: { id: "c2", name: "random" }, |
| 90 | +}, |
| 91 | +{ |
| 92 | +kind: "group", |
| 93 | +id: "channel:c3", |
| 94 | +name: "announcements", |
| 95 | +handle: "#announcements", |
| 96 | +raw: { id: "c3", name: "announcements" }, |
| 97 | +}, |
86 | 98 | ]); |
87 | 99 | }); |
88 | 100 | |
@@ -108,19 +120,22 @@ describe("discord directory live lookups", () => {
|
108 | 120 | const rows = await listDiscordDirectoryPeersLive(makeParams({ query: "alice", limit: 2 })); |
109 | 121 | |
110 | 122 | expect(rows).toEqual([ |
111 | | -expect.objectContaining({ |
| 123 | +{ |
112 | 124 | kind: "user", |
113 | 125 | id: "user:u1", |
114 | 126 | name: "Ali", |
115 | 127 | handle: "@alice", |
116 | 128 | rank: 1, |
117 | | -}), |
118 | | -expect.objectContaining({ |
| 129 | +raw: { user: { id: "u1", username: "alice", bot: false }, nick: "Ali" }, |
| 130 | +}, |
| 131 | +{ |
119 | 132 | kind: "user", |
120 | 133 | id: "user:u2", |
| 134 | +name: "alice-bot", |
121 | 135 | handle: "@alice-bot", |
122 | 136 | rank: 0, |
123 | | -}), |
| 137 | +raw: { user: { id: "u2", username: "alice-bot", bot: true }, nick: null }, |
| 138 | +}, |
124 | 139 | ]); |
125 | 140 | }); |
126 | 141 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。