Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
alweber-cap committed Sep 25, 2023
1 parent ee02ac1 commit 53d5d01
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions apps/server/src/modules/user-import/uc/user-import.uc.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,7 @@ describe('[ImportUserModule]', () => {

userMatch1 = userFactory.buildWithId({ school });
userMatch2 = userFactory.buildWithId({ school });

importUser1 = importUserFactory.buildWithId({
school,
user: userMatch1,
Expand All @@ -505,13 +506,15 @@ describe('[ImportUserModule]', () => {
userRepoFlushSpy = userRepo.flush.mockResolvedValueOnce();
permissionServiceSpy = authorizationService.checkAllPermissions.mockReturnValue();
importUserRepoFindImportUsersSpy = importUserRepo.findImportUsers.mockResolvedValue([[], 0]);
accountServiceFindByUserIdSpy = accountService.findByUserIdOrFail.mockResolvedValue({
id: 'dummyId',
userId: currentUser.id,
username: currentUser.email,
createdAt: new Date(),
updatedAt: new Date(),
});
accountServiceFindByUserIdSpy = accountService.findByUserId
.mockResolvedValue({
id: 'dummyId',
userId: currentUser.id,
username: currentUser.email,
createdAt: new Date(),
updatedAt: new Date(),
})
.mockResolvedValueOnce(null);
importUserRepoDeleteImportUsersBySchoolSpy = importUserRepo.deleteImportUsersBySchool.mockResolvedValue();
importUserRepoDeleteImportUserSpy = importUserRepo.delete.mockResolvedValue();
schoolServiceSaveSpy = schoolService.save.mockReturnValueOnce(Promise.resolve(createMockSchoolDo(school)));
Expand Down

0 comments on commit 53d5d01

Please sign in to comment.