From efbeb29196e696edea7d9a41ffae961d0e6ca1c1 Mon Sep 17 00:00:00 2001 From: GeunH Date: Wed, 29 Nov 2023 22:06:00 +0900 Subject: [PATCH] =?UTF-8?q?feat=20:=20=EB=8B=89=EB=84=A4=EC=9E=84=20?= =?UTF-8?q?=EC=A4=91=EB=B3=B5=ED=99=95=EC=9D=B8=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=EC=BD=94=EB=93=9C=20=EC=9E=91=EC=84=B1=20#35?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- be/src/user/user.service.spec.ts | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/be/src/user/user.service.spec.ts b/be/src/user/user.service.spec.ts index 9669afc6..5e2f2db8 100644 --- a/be/src/user/user.service.spec.ts +++ b/be/src/user/user.service.spec.ts @@ -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: "test@email.com", + 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 = {