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/getUserInfo.ts

15 lines
420 B

import type { IUser } from '@rocket.chat/core-typings';
import type { BaseTest } from './test';
export const getUserInfo = async (api: BaseTest['api'], username: string): Promise<IUser | undefined> => {
const response = await api.get(`/users.info?username=${username}`);
if (response.status() !== 200) {
throw new Error('Failed to get user info.');
}
const data = await response.json();
return data.user;
};