diff --git a/libs/tasks/interface-adapters/src/lib/resolver/user-tasks.resolver.spec.ts b/libs/tasks/interface-adapters/src/lib/resolver/user-tasks.resolver.spec.ts index 1f483c7..15c44a3 100644 --- a/libs/tasks/interface-adapters/src/lib/resolver/user-tasks.resolver.spec.ts +++ b/libs/tasks/interface-adapters/src/lib/resolver/user-tasks.resolver.spec.ts @@ -34,7 +34,7 @@ describe('UserTasksResolver', () => { it('should return user tasks for given userId and range', async () => { const userId = 'test-user-id'; const range = { from: new Date(), to: new Date() }; - const result = await resolver.findUserTasks(userId, range); + const result = await resolver.getUserTasks(userId, range); expect(service.findMany).toHaveBeenCalledWith(userId, range); expect(result).toEqual([]); }); diff --git a/libs/users/infrastructure/mongoose/src/lib/mongoose-users.repository.spec.ts b/libs/users/infrastructure/mongoose/src/lib/mongoose-users.repository.spec.ts deleted file mode 100644 index e5cec76..0000000 --- a/libs/users/infrastructure/mongoose/src/lib/mongoose-users.repository.spec.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { Test, TestingModule } from '@nestjs/testing'; -import { getModelToken } from '@nestjs/mongoose'; -import { Model } from 'mongoose'; -import { MongooseUsersRepository } from './mongoose-users.repository'; -import { UserDocument } from './user.schema'; -import { User } from '@users/domain'; - -describe('MongooseUsersRepository', () => { - let repository: MongooseUsersRepository; - let userModel: Model; - - beforeEach(async () => { - const module: TestingModule = await Test.createTestingModule({ - providers: [ - MongooseUsersRepository, - { - provide: getModelToken(UserDocument.name), - useValue: { - findOneById: jest.fn(), - }, - }, - ], - }).compile(); - - repository = module.get(MongooseUsersRepository); - userModel = module.get>( - getModelToken(UserDocument.name), - ); - }); - - it('should return a user when found', async () => { - const user = await repository.findOneById('123'); - expect(user).toBeInstanceOf(User); - }); - - it('should return null when user is not found', async () => { - const user = await repository.findOneById('123'); - expect(user).toBeNull(); - }); - - it('should return a user when found by email', async () => { - const user = await repository.findOneByEmail('john@example.com'); - expect(user).toBeInstanceOf(User); - }); - - it('should return null when user is not found by email', async () => { - const user = await repository.findOneByEmail('john@example.com'); - expect(user).toBeNull(); - }); -});