Skip to content

Commit

Permalink
Add more tests to UsersService
Browse files Browse the repository at this point in the history
  • Loading branch information
MrBartusek committed Apr 14, 2024
1 parent 87a049c commit 301b4c0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions apps/api/src/models/users/users.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,14 @@ describe('UsersService', () => {
const user = await service.setConfirmed(new Types.ObjectId(), true);
expect(user.profile.username).toStrictEqual(expect.any(String));
});

it('should check if exist', async () => {
const exist = await service.exist(new Types.ObjectId());
expect(exist).toBe(true);
});

it('should find one by id and update', async () => {
const user = await service.findOneByIdAndUpdate(new Types.ObjectId(), { username: 'test' });
expect(user.profile.username).toStrictEqual(expect.any(String));
});
});

0 comments on commit 301b4c0

Please sign in to comment.