Skip to content

Commit

Permalink
test: AuthService 통합 테스트 추가
Browse files Browse the repository at this point in the history
- AuthService의 naverSignIn 메서드에 대한 통합 테스트 작성
  • Loading branch information
JoonSoo-Kim committed Dec 5, 2023
1 parent f2f96f4 commit 7a755d3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions BE/test/int/auth.service.int-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { AuthCredentialsDto } from "src/auth/dto/auth-credential.dto";
import { Request } from "express";
import { AccessTokenDto } from "src/auth/dto/auth-access-token.dto";
import { NotFoundException } from "@nestjs/common";
import { providerEnum } from "src/utils/enum";

describe("AuthService 통합 테스트", () => {
let authService: AuthService;
Expand Down Expand Up @@ -132,4 +133,21 @@ describe("AuthService 통합 테스트", () => {
expect(result).toBeInstanceOf(AccessTokenDto);
});
});

describe("naverSignIn 메서드", () => {
it("메서드 정상 요청", async () => {
const user = new User();
user.email = "[email protected]";
user.userId = "test*naver";
user.nickname = "test";
user.password = "test";
user.provider = providerEnum.NAVER;

const request = { ip: "111.111.111.111" } as Request;

const result = await authService.naverSignIn(user, request);

expect(result).toBeInstanceOf(AccessTokenDto);
});
});
});

0 comments on commit 7a755d3

Please sign in to comment.