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 4dfd794 commit efbeb29
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions be/src/user/user.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,35 @@ describe("마이페이지", () => {
afterAll(async () => {
await dataSource.destroy();
});
it("닉네임 중복 확인 요청", async () => {

const firstResult = await userService.getNickNameAvailability("hi");

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.getNickNameAvailability("hi");

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

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

0 comments on commit efbeb29

Please sign in to comment.