test authorization module

This commit is contained in:
Gsk54 2023-01-16 17:37:01 +01:00
parent f67a0ef870
commit 3d2bb613bd
1 changed files with 3 additions and 3 deletions

View File

@ -11,7 +11,7 @@ describe('AuthenticationRepository', () => {
let prismaService: PrismaService;
let authenticationRepository: AuthenticationRepository;
const createAuths = async (nbToCreate = 10) => {
const createAuthentications = async (nbToCreate = 10) => {
for (let i = 0; i < nbToCreate; i++) {
await prismaService.auth.create({
data: {
@ -52,14 +52,14 @@ describe('AuthenticationRepository', () => {
});
it('should return a data array with 8 auths', async () => {
await createAuths(8);
await createAuthentications(8);
const auths = await authenticationRepository.findAll();
expect(auths.data.length).toBe(8);
expect(auths.total).toBe(8);
});
it('should return a data array limited to 10 authentications', async () => {
await createAuths(20);
await createAuthentications(20);
const auths = await authenticationRepository.findAll();
expect(auths.data.length).toBe(10);
expect(auths.total).toBe(20);