mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-06-01 07:38:33 -04:00
feat(user-info-dto): split email into separate DTO
The email address should only be available in /me routes. This commit splits the email address into a new FullUserInfoDto. Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
a7edf00ebc
commit
0394679134
7 changed files with 44 additions and 12 deletions
|
@ -148,6 +148,18 @@ describe('UsersService', () => {
|
|||
expect(userDto.username).toEqual(username);
|
||||
expect(userDto.displayName).toEqual(displayname);
|
||||
expect(userDto.photo).toEqual('');
|
||||
});
|
||||
});
|
||||
|
||||
describe('toFullUserDto', () => {
|
||||
const username = 'hardcoded';
|
||||
const displayname = 'Testy';
|
||||
const user = User.create(username, displayname) as User;
|
||||
it('works if a user is provided', () => {
|
||||
const userDto = service.toFullUserDto(user);
|
||||
expect(userDto.username).toEqual(username);
|
||||
expect(userDto.displayName).toEqual(displayname);
|
||||
expect(userDto.photo).toEqual('');
|
||||
expect(userDto.email).toEqual('');
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue