mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-19 09:48:39 +00:00
chore: Fix hanging test.
This commit is contained in:
@@ -185,24 +185,27 @@ describe("mattermost websocket monitor", () => {
|
|||||||
webSocketFactory: () => socket,
|
webSocketFactory: () => socket,
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.emitOpen();
|
const connected = connectOnce();
|
||||||
socket.emitMessage(
|
queueMicrotask(() => {
|
||||||
Buffer.from(
|
socket.emitOpen();
|
||||||
JSON.stringify({
|
socket.emitMessage(
|
||||||
event: "reaction_added",
|
Buffer.from(
|
||||||
data: {
|
JSON.stringify({
|
||||||
reaction: JSON.stringify({
|
event: "reaction_added",
|
||||||
user_id: "user-1",
|
data: {
|
||||||
post_id: "post-1",
|
reaction: JSON.stringify({
|
||||||
emoji_name: "thumbsup",
|
user_id: "user-1",
|
||||||
}),
|
post_id: "post-1",
|
||||||
},
|
emoji_name: "thumbsup",
|
||||||
}),
|
}),
|
||||||
),
|
},
|
||||||
);
|
}),
|
||||||
socket.emitClose(1000);
|
),
|
||||||
|
);
|
||||||
|
socket.emitClose(1000);
|
||||||
|
});
|
||||||
|
|
||||||
await connectOnce();
|
await connected;
|
||||||
|
|
||||||
expect(onReaction).toHaveBeenCalledTimes(1);
|
expect(onReaction).toHaveBeenCalledTimes(1);
|
||||||
expect(onPosted).not.toHaveBeenCalled();
|
expect(onPosted).not.toHaveBeenCalled();
|
||||||
|
|||||||
Reference in New Issue
Block a user