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