fix: await control ui chat startup refresh · openclaw/openclaw@0fd6607
shakkernerd
·
2026-05-07
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -198,21 +198,21 @@ beforeEach(() => {
|
198 | 198 | }); |
199 | 199 | |
200 | 200 | describe("connectGateway chat load startup work", () => { |
201 | | -it("lets the active chat refresh own avatar loading on initial chat hello", () => { |
| 201 | +it("lets the active chat refresh own avatar loading on initial chat hello", async () => { |
202 | 202 | const { host, client } = connectHost("chat"); |
203 | 203 | |
204 | 204 | client.emitHello(); |
205 | 205 | |
206 | | -expect(refreshActiveTabMock).toHaveBeenCalledWith(host); |
| 206 | +await vi.waitFor(() => expect(refreshActiveTabMock).toHaveBeenCalledWith(host)); |
207 | 207 | expect(refreshChatAvatarMock).not.toHaveBeenCalled(); |
208 | 208 | }); |
209 | 209 | |
210 | | -it("still preloads the chat avatar when connecting outside the chat tab", () => { |
| 210 | +it("still preloads the chat avatar when connecting outside the chat tab", async () => { |
211 | 211 | const { host, client } = connectHost("overview"); |
212 | 212 | |
213 | 213 | client.emitHello(); |
214 | 214 | |
215 | | -expect(refreshActiveTabMock).toHaveBeenCalledWith(host); |
| 215 | +await vi.waitFor(() => expect(refreshActiveTabMock).toHaveBeenCalledWith(host)); |
216 | 216 | expect(refreshChatAvatarMock).toHaveBeenCalledWith(host); |
217 | 217 | }); |
218 | 218 | }); |
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。