forked from yy0ung/nibobnebob
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat : 유저 회원탈퇴, 유저 정보 업데이트 테스트 함수 구현 #35
- Loading branch information
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
}) | ||
); | ||
}); | ||
}); |