The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/tests/e2e/utils/sendMessage.ts

19 lines
550 B

import type { APIRequestContext } from 'playwright-core';
import { BASE_API_URL } from '../config/constants';
import type { IUserState } from '../fixtures/userStates';
export const sendMessageFromUser = async (request: APIRequestContext, user: IUserState, rid: string, message: string) => {
return request
.post(`${BASE_API_URL}/chat.postMessage`, {
headers: {
'X-Auth-Token': user.data.loginToken,
'X-User-Id': user.data._id,
},
data: {
roomId: rid,
text: message,
},
})
.then((response) => response.json());
};