repositories integration tests

This commit is contained in:
sbriat 2023-07-13 09:04:54 +02:00
parent 0ccaafc5e0
commit c3f31c4d2a
1 changed files with 5 additions and 5 deletions

View File

@ -74,7 +74,7 @@ describe('UsernameRepository', () => {
});
});
describe('findOne', () => {
describe('findByName', () => {
it('should return a Username', async () => {
await prismaService.username.create({
data: {
@ -84,9 +84,9 @@ describe('UsernameRepository', () => {
},
});
const username = await usernameRepository.findOne({
username: 'john.doe@email.com',
});
const username = await usernameRepository.findByName(
'john.doe@email.com',
);
expect(username.id).toBe('john.doe@email.com');
});
@ -184,7 +184,7 @@ describe('UsernameRepository', () => {
const toDelete: UsernameEntity = await UsernameEntity.create(
createUsernameProps,
);
await usernameRepository.delete(toDelete);
await usernameRepository.deleteUsername(toDelete);
const count = await prismaService.username.count();
expect(count).toBe(0);