Skip to content

Commit

Permalink
feat : 유저 회원탈퇴, 유저 정보 업데이트 테스트 함수 구현 #35
Browse files Browse the repository at this point in the history
  • Loading branch information
GeunH committed Nov 29, 2023
1 parent c6ef3f3 commit ab52bce
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions be/src/user/user.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,4 +174,66 @@ describe("마이페이지", () => {
})
);
});

it("유저 회원탈퇴", async () => {
const userInfoDto: UserInfoDto = {
email: "[email protected]",
password: "1234",
provider: " ",
nickName: "hi",
region: "인천",
birthdate: "1999/10/13",
isMale: true
};
const userRepository = dataSource.getRepository(User);
const id = await userRepository.save(userInfoDto);

await userService.deleteUserAccount(id)

const result = await userRepository.findOne({ where: { id: id["id"] } });

expect(result).toEqual(await
expect.objectContaining({

})
);
});
it("유저 정보 업데이트", async () => {
const userInfoDto: UserInfoDto = {
email: "[email protected]",
password: "1234",
provider: " ",
nickName: "hi",
region: "인천",
birthdate: "1999/10/13",
isMale: true
};
const userRepository = dataSource.getRepository(User);
const id = await userRepository.save(userInfoDto);

const userUpdateInfoDto: UserInfoDto = {
email: "[email protected]",
password: "4321",
provider: " ",
nickName: "Good",
region: "서울",
birthdate: "2000/01/03",
isMale: false
}

await userService.updateMypageUserInfo(id, userUpdateInfoDto)

const result = await userRepository.findOne({ where: { id: id["id"] } });
expect(result).toEqual(await
expect.objectContaining({
email: "[email protected]",
password: "4321",
provider: " ",
nickName: "Good",
region: "서울",
birthdate: "2000/01/03",
isMale: false
})
);
});
});

0 comments on commit ab52bce

Please sign in to comment.