mirror of
https://github.com/moltbot/moltbot.git
synced 2026-05-13 23:56:07 +00:00
fix: await control ui chat startup refresh
This commit is contained in:
@@ -198,21 +198,21 @@ beforeEach(() => {
|
||||
});
|
||||
|
||||
describe("connectGateway chat load startup work", () => {
|
||||
it("lets the active chat refresh own avatar loading on initial chat hello", () => {
|
||||
it("lets the active chat refresh own avatar loading on initial chat hello", async () => {
|
||||
const { host, client } = connectHost("chat");
|
||||
|
||||
client.emitHello();
|
||||
|
||||
expect(refreshActiveTabMock).toHaveBeenCalledWith(host);
|
||||
await vi.waitFor(() => expect(refreshActiveTabMock).toHaveBeenCalledWith(host));
|
||||
expect(refreshChatAvatarMock).not.toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it("still preloads the chat avatar when connecting outside the chat tab", () => {
|
||||
it("still preloads the chat avatar when connecting outside the chat tab", async () => {
|
||||
const { host, client } = connectHost("overview");
|
||||
|
||||
client.emitHello();
|
||||
|
||||
expect(refreshActiveTabMock).toHaveBeenCalledWith(host);
|
||||
await vi.waitFor(() => expect(refreshActiveTabMock).toHaveBeenCalledWith(host));
|
||||
expect(refreshChatAvatarMock).toHaveBeenCalledWith(host);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user