tests: chat: Wait for message ack

rhansen-chat
Richard Hansen 2022-04-07 18:03:07 -04:00
parent 8d062b254e
commit 33c46cb002
1 changed files with 4 additions and 9 deletions

View File

@ -31,15 +31,10 @@ const checkHook = async (hookName, checkFn) => {
});
};
const sendMessage = (socket, data) => {
socket.send({
type: 'COLLABROOM',
component: 'pad',
data,
});
};
const sendChat = (socket, message) => sendMessage(socket, {type: 'CHAT_MESSAGE', message});
const sendMessage = async (socket, data) => (
await common.sendMessage(socket, {type: 'COLLABROOM', component: 'pad', data}));
const sendChat = async (socket, message) => (
await sendMessage(socket, {type: 'CHAT_MESSAGE', message}));
describe(__filename, function () {
const padId = 'testChatPad';