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/client/lib/getUserDisplayName.spec.ts

16 lines
513 B

import { getUserDisplayName } from '@rocket.chat/core-typings';
const fakeUser = {
name: 'John Doe',
username: 'john.doe',
};
it('should return username if UI_Use_Real_Name setting is false', () => {
const result = getUserDisplayName(fakeUser.name, fakeUser.username, false);
expect(result).toBe(fakeUser.username);
});
it('should return name if UI_Use_Real_Name setting is true', () => {
const result = getUserDisplayName(fakeUser.name, fakeUser.username, true);
expect(result).toBe(fakeUser.name);
});