fix: tests
This commit is contained in:
parent
4f77d06592
commit
839cc4f3f8
3 changed files with 3 additions and 2 deletions
|
@ -17,7 +17,7 @@ export const getRandomAvatarColor = (): UserAvatarColor => {
|
|||
const values = Object.values(UserAvatarColor);
|
||||
const randomIndex = Math.floor(Math.random() * values.length);
|
||||
return values[randomIndex] as UserAvatarColor;
|
||||
}
|
||||
};
|
||||
|
||||
export class UserDto {
|
||||
id!: string;
|
||||
|
|
|
@ -105,7 +105,7 @@ export class UserCore {
|
|||
if (payload.storageLabel) {
|
||||
payload.storageLabel = sanitize(payload.storageLabel);
|
||||
}
|
||||
payload.avatarColor = getRandomAvatarColor()
|
||||
payload.avatarColor = getRandomAvatarColor();
|
||||
const userEntity = await this.userRepository.create(payload);
|
||||
await this.libraryRepository.create({
|
||||
owner: { id: userEntity.id } as UserEntity,
|
||||
|
|
|
@ -312,6 +312,7 @@ describe(UserService.name, () => {
|
|||
|
||||
expect(userMock.getAdmin).toBeCalled();
|
||||
expect(userMock.create).toBeCalledWith({
|
||||
avatarColor: expect.anything(),
|
||||
email: userStub.user1.email,
|
||||
firstName: userStub.user1.firstName,
|
||||
lastName: userStub.user1.lastName,
|
||||
|
|
Loading…
Reference in a new issue