fix: tests

This commit is contained in:
martabal 2023-11-01 19:14:46 +01:00
parent 4f77d06592
commit 839cc4f3f8
No known key found for this signature in database
GPG key ID: C00196E3148A52BD
3 changed files with 3 additions and 2 deletions

View file

@ -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;

View file

@ -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,

View file

@ -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,