Skip to content

Commit

Permalink
feat : 닉네임 중복확인, 이메일 중복확인 api 테스트 코드 구현 #35
Browse files Browse the repository at this point in the history
  • Loading branch information
GeunH committed Nov 29, 2023
1 parent efbeb29 commit 8fd2b52
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions be/src/user/user.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,36 @@ describe("마이페이지", () => {
);
});

it("이메일 중복 확인 요청", async () => {

const firstResult = await userService.getEmailAvailability("[email protected]");

expect(firstResult).toEqual(await
expect.objectContaining({
isexist: false
})
);
const userInfoDto: UserInfoDto = {
email: "[email protected]",
password: "1234",
provider: " ",
nickName: "hi",
region: "인천",
birthdate: "1999/10/13",
isMale: true
};
const userRepository = dataSource.getRepository(User);
await userRepository.save(userInfoDto);

const result = await userService.getEmailAvailability("[email protected]");

expect(result).toEqual(await
expect.objectContaining({
isexist: true
})
);
});

it("마이페이지 정보 요청", async () => {
const userInfoDto: UserInfoDto = {
email: "[email protected]",
Expand Down

0 comments on commit 8fd2b52

Please sign in to comment.