Skip to content

refactor(test): share fixtures and simplify tests - #271

Merged
pbk95120 merged 1 commit into
developfrom
refactor/test-and-code-cleanup
Sep 11, 2026
Merged

pbk95120 merged 1 commit into
developfrom
refactor/test-and-code-cleanup

Conversation

@pbk95120

@pbk95120 pbk95120 commented Sep 11, 2026 •

Copy link
Copy Markdown
Collaborator

📝 작업 내용 요약

  • 혜택 테스트에서 반복되던 PolicySummary·PolicyDetail fixture를 공용 테스트 fixture로 통합했습니다.
  • 탈퇴 성공 경로의 테스트 전용 onWithdrawn 주입을 제거해 실제 온보딩 이동 동작을 검증하도록 정리했습니다.
  • 네이티브 토큰 정리 케이스를 it.each로 통합하고 탈퇴 실패 시 오류·다이얼로그 유지 동작을 확인하도록 테스트를 정리했습니다.

✅ 체크리스트

  • develop 브랜치의 최신 코드를 pull 받았나요?
  • 빌드가 통과했나요?
  • vitest 테스트가 통과했나요?
  • Playwright e2e가 통과했나요?

🤖 AI 리뷰

Claude 리뷰 (사용자 승인으로 생략)

  • Claude Opus 5 리뷰는 사용자 승인에 따라 생략했습니다.
  • 구현 모델: Codex gpt-6-astra; PR 담당: Luna max.

💬 기타 코멘트

  • develop 기준 검증: Turbo 20개 태스크 성공, 웹 Vitest 86개 파일·439개 테스트 통과, Playwright E2E 28개 통과.
  • pre-push 훅의 test·typecheck도 지정 환경에서 통과했습니다.

변경 사항

  • PolicySummary와 PolicyDetail 테스트 픽스처를 공용 policy 및 policyDetail 팩토리로 통합했습니다.
  • WithdrawalButton에서 onWithdrawn prop을 제거했습니다.
  • 탈퇴 성공 시 실제 동작인 moveToNewGuestOnboarding()을 호출하도록 변경했습니다.
  • 네이티브 토큰 정리 테스트를 it.each로 통합했습니다.
  • 탈퇴 실패 시 오류 안내와 다이얼로그 유지 동작을 함께 검증하도록 테스트를 정리했습니다.

@pbk95120 pbk95120 self-assigned this Sep 11, 2026
@pbk95120
pbk95120 requested a review from jongse7 September 11, 2026 00:47
@vercel

vercel Bot commented Sep 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
28th-web-team-3-fe-web-dev Ready Ready Preview Sep 11, 2026 12:47am UTC
1 Skipped Deployment
Project Deployment Actions Updated
28th-web-team-3-fe-admin Ignored Ignored Sep 11, 2026 12:47am UTC

@coderabbitai

coderabbitai Bot commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: ff4a7b92-6d94-43cb-83d0-1568a0a4b607

📥 Commits

Reviewing files that changed from the base of the PR and between f317133 and bb03cf2.

📒 Files selected for processing (6)
  • apps/web/app/(tabs)/benefits/_components/benefits-explorer.test.tsx
  • apps/web/app/(tabs)/benefits/lib/policy-category-cache.test.ts
  • apps/web/app/(tabs)/benefits/saved/_components/saved-benefits.test.tsx
  • apps/web/app/(tabs)/mypage/_components/withdrawal-button.test.tsx
  • apps/web/app/(tabs)/mypage/_components/withdrawal-button.tsx
  • apps/web/lib/test/fixtures/policy.ts

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

Changes

정책 테스트 픽스처를 공용화했습니다. 탈퇴 버튼은 성공 시 직접 온보딩으로 이동하며, 관련 테스트는 이동·캐시·토큰·실패 상태를 검증합니다.

정책 테스트 픽스처 통합

Layer / File(s) Summary
공용 정책 픽스처 추가
apps/web/lib/test/fixtures/policy.ts
PolicySummary와 PolicyDetail 기본 객체를 생성하는 policy 및 policyDetail 픽스처를 추가했습니다.
혜택 테스트 픽스처 전환
apps/web/app/(tabs)/benefits/...
혜택 관련 테스트의 로컬 픽스처를 공용 픽스처로 교체했습니다. 카테고리 값은 options 객체로 전달합니다.

탈퇴 버튼 성공 동작 변경

Layer / File(s) Summary
탈퇴 성공 동작 고정
apps/web/app/(tabs)/mypage/_components/withdrawal-button.tsx
onWithdrawn prop을 제거했습니다. 탈퇴 성공 시 moveToNewGuestOnboarding()을 직접 호출합니다.
탈퇴 상태 검증 갱신
apps/web/app/(tabs)/mypage/_components/withdrawal-button.test.tsx
온보딩 이동, 캐시 정리 순서, 토큰 정리 조건, 실패 시 화면과 다이얼로그 유지를 검증하도록 테스트를 변경했습니다.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~12 minutes

Merge Risk: ⚪ Minimal · up to bb03c

The test refactor and withdrawal-flow update do not leave an actionable current-head risk.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 6 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 제목은 테스트 픽스처 공유와 테스트 단순화라는 PR의 주요 변경 사항을 간결하고 명확하게 설명합니다.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/test-and-code-cleanup

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@pbk95120
pbk95120 merged commit 61d9826 into develop Sep 11, 2026
7 checks passed
@pbk95120
pbk95120 deleted the refactor/test-and-code-cleanup branch September 11, 2026 05:05

This branch was successfully deployed

1 active deployment
Preview – 28th-web-team-3-fe-web-dev — bb03cf2e Deployed Sep 11, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant