refactor(api): DEFAULT_CATEGORIES 중복 제거 및 OAuth 테스트 추가#115
Conversation
- auth.service.ts에서 로컬 DEFAULT_CATEGORIES 제거, 공통 타입에서 import - oauth.service.ts에서 로컬 DEFAULT_CATEGORIES 제거, 공통 타입에서 import - oauth.service.spec.ts에 기본 카테고리 생성 Unit 테스트 6개 추가 - Apple/Google/Kakao/Naver 로그인 시 기본 카테고리 2개 생성 검증 - 기존 사용자 재로그인 시 카테고리 미생성 검증 - oauth.integration-spec.ts에 기본 카테고리 생성 Integration 테스트 5개 추가 - 실제 DB에 카테고리 생성 및 속성(이름, 색상, 순서) 검증 - 기존 사용자 재로그인 시 중복 생성 방지 검증 - .gitignore 업데이트
- biome.json overrides 설정 추가 - *.spec.ts, *.test.ts 파일에서 any 타입 사용 허용 - 테스트 mock 객체 생성 시 필요한 유연성 확보
Summary of ChangesHello @dydals3440, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 PR은 Highlights
Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
이 PR은 DEFAULT_CATEGORIES 상수의 중복 정의를 제거하여 코드를 리팩토링하고, 모든 OAuth 제공자에 대한 기본 카테고리 생성 로직의 단위 및 통합 테스트를 추가하여 코드 품질과 안정성을 크게 향상시켰습니다. 전반적으로 훌륭한 변경입니다.
다만, 새로 추가된 테스트 코드에 중복이 있어 it.each를 사용하여 리팩토링하면 가독성과 유지보수성을 더욱 높일 수 있을 것 같습니다. 이는 중복 로직이 세 곳 이상에서 발견될 때 추상화를 고려하라는 규칙과도 일치합니다. 자세한 내용은 각 파일에 남긴 주석을 참고해주세요.
- oauth.service.spec.ts: Provider별 테스트를 it.each로 통합 - oauth.integration-spec.ts: 기본 카테고리 생성 테스트를 it.each로 통합 - 코드 중복 85줄 감소 (254줄 → 169줄) Gemini 코드 리뷰 피드백 반영
📋 요약
기본 카테고리(DEFAULT_CATEGORIES) 중복 정의를 제거하고 단일 소스로 통합하며, 모든 OAuth 소셜 로그인(Apple/Google/Kakao/Naver) 시 기본 카테고리 생성에 대한 테스트를 추가합니다.
🔗 관련 이슈
Closes #114
📝 변경 내용
1. DEFAULT_CATEGORIES 통합
auth.service.ts의 로컬 정의 제거 →todo-category.types.ts에서 importoauth.service.ts의 로컬 정의 제거 →todo-category.types.ts에서 import2. Unit 테스트 추가 (
oauth.service.spec.ts)3. Integration 테스트 추가 (
oauth.integration-spec.ts)4. Biome 설정 개선
*.spec.ts,*.test.ts)에서noExplicitAny규칙 비활성화✅ 체크리스트