fix: await control ui chat startup refresh

This commit is contained in:
Shakker
2026-05-07 11:50:44 +01:00
parent 7ad53cefee
commit 0fd6607d56

View File

@@ -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);
});
});