Skip to content

Conversation

@Chiman2937
Copy link
Member

@Chiman2937 Chiman2937 commented Dec 23, 2025

📝 변경 사항

마이페이지 - 프로필 수정 모달 테스트 코드를 작성하였습니다.
API 정상 동작 테스트는 추후 진행 예정입니다.

  ProfileEditModal 테스트
    렌더링 테스트                                                                                                                                                                                                    
      √ 프로필 수정 모달이 정상적으로 렌더링 된다. (123 ms)                                                                                                                                                          
      √ 초기값이 user 데이터로 설정된다. (19 ms)                                                                                                                                                                     
    필드 입력 테스트                                                                                                                                                                                                 
      √ 닉네임 입력이 정상적으로 동작한다. (195 ms)                                                                                                                                                                  
      √ 프로필 메시지 입력이 정상적으로 동작한다. (216 ms)                                                                                                                                                           
      √ MBTI 메시지 입력이 정상적으로 동작한다. (139 ms)                                                                                                                                                             
    유효성 검사 테스트                                                                                                                                                                                               
      닉네임 유효성 검사 테스트                                                                                                                                                                                      
        √ 닉네임이 2글자 미만이면 에러 메시지가 표시된다. (139 ms)                                                                                                                                                   
        √ 닉네임이 20글자를 초과하면 에러 메시지가 표시된다. (402 ms)                                                                                                                                                
      프로필 메시지 유효성 검사 테스트                                                                                                                                                                               
        √ 프로필 메시지가 20글자를 초과하면 에러 메시지가 표시된다. (405 ms)                                                                                                                                         
      MBTI 유효성 검사 테스트                                                                                                                                                                                        
        √ 유효하지 않은 MBTI 입력 시 에러 메시지가 표시된다. (122 ms)                                                                                                                                                
        √ 대/소문자 관계없이 MBTI 입력이 가능하다. (170 ms)                                                                                                                                                          
        √ 유효한 MBTI를 입력 중이라면 Blur 되기 전까지 에러 메시지가 나타나지 않는다. (123 ms)                                                                                                                       
        √ MBTI가 4글자가 아닌 상태에서 blur 시 에러 메시지가 표시된다. (171 ms)                                                                                                                                      
        √ 유효한 MBTI를 입력 후 blur 시 에러 메시지가 표시되지 않는다. (200 ms)                                                                                                                                      
      제출 버튼 상태 테스트                                                                                                                                                                                          
        √ 유효성 검사 성공 시 제출 버튼이 활성화 된다. (572 ms)                                                                                                                                                      
        √ 유효성 검사 실패 시 제출 버튼이 비활성화 된다. (140 ms)  

🔗 관련 이슈

Closes #


🧪 테스트 방법

  • 수동 테스트 검증(로컬 환경)
  • 유닛 테스트 검증
  • 통합 테스트 검증

📸 스크린샷 (선택)


📋 체크리스트

  • 관련 문서를 업데이트했습니다 (필요한 경우)
  • 테스트를 추가/수정했습니다 (필요한 경우)
  • Breaking change가 있다면 명시했습니다

💬 추가 코멘트


CodeRabbit Review는 자동으로 실행되지 않습니다.

Review를 실행하려면 comment에 아래와 같이 작성해주세요

@coderabbitai review

Summary by CodeRabbit

릴리스 노트

  • Tests

    • 프로필 편집 모달에 대한 새로운 테스트 스위트 추가. 컴포넌트 렌더링, 폼 필드 초기화, 닉네임·프로필 메시지·MBTI 입력 및 유효성 검사, 오류 메시지 표시, 제출 버튼 상태 관리 확인.
  • Chores

    • 유효성 검사 오류 메시지 업데이트.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 23, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

ProfileEditModal 컴포넌트의 새로운 테스트 스위트를 추가하고, 모달의 필드 검증 및 form 동작을 테스트합니다. MBTI 유효성 검사 에러 메시지의 일관성을 개선합니다.

Changes

코호트 / 파일(s) 변경 사항 요약
테스트 스위트 추가
src/components/pages/user/profile/profile-edit-modal/index.test.tsx
ProfileEditModal 컴포넌트의 전체 테스트 커버리지 추가: 모달 렌더링, form 필드 초기화, 닉네임/프로필 메시지/MBTI 입력 검증, submit 버튼 상태 관리
유효성 검사 메시지 개선
src/lib/schema/mypage.ts
MBTI 검증 스키마의 에러 메시지 문자열 수정: 마침표 추가 및 메시지 통일 (mbtiOnChangeSchema, mbtiOnBlurSchema)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • wooktori

Poem

🐰 테스트 작성하고 메시지 다듬고,
폼의 검증이 단정해졌네요!
MBTI 마침표 반짝반짝,
모달의 안전함이 배로 커졌어요! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 inconclusive)
Check name Status Explanation Resolution
Description check ❓ Inconclusive PR 설명은 변경 사항, 테스트 결과 등이 포함되어 있지만, 관련 이슈 연결과 테스트 방법 검증 항목이 미완료 상태입니다. 관련 이슈 번호를 명시하고, 테스트 방법 섹션에서 적절한 검증 방법에 체크 표시를 추가해주세요.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed PR 제목은 변경 사항의 주요 내용을 명확하게 반영하고 있으며, 마이페이지 프로필 수정 모달 UI 테스트 코드 작성이라는 핵심 변경을 정확하게 설명합니다.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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 and usage tips.

@github-actions
Copy link

github-actions bot commented Dec 23, 2025

🎭 Playwright Report

E2E Test가 성공적으로 완료되었습니다.

Test 요약 내용을 확인해주세요.

Status Build Log Updated (UTC)
✅ Ready View Build 2025-12-23 06:28:54

📊 Test Summary

  • ✅ Passed: 3
  • ❌ Failed: 0
  • ⏱️ Duration: 28.0s

📜 Test Details

✅ Passed Tests (3)
  • profile.test.ts (3)
    • [chromium] 존재하지 않는 프로필 페이지로 접속 시 404 redirect 되는 지 테스트
    • [firefox] 존재하지 않는 프로필 페이지로 접속 시 404 redirect 되는 지 테스트
    • [webkit] 존재하지 않는 프로필 페이지로 접속 시 404 redirect 되는 지 테스트

@github-actions
Copy link

github-actions bot commented Dec 23, 2025

🚀 PR Preview Report

Build가 성공적으로 완료되었습니다.

Preview에서 변경사항을 확인하세요.

Status Preview Build Log Updated (UTC)
✅ Ready Visit Preview View Logs 2025-12-23 06:28:41

@github-actions
Copy link

github-actions bot commented Dec 23, 2025

🎨 Storybook Report

변경 사항이 없습니다

모든 Story가 이전 빌드와 동일합니다.

Status Storybook Build Log Updated (UTC)
✅ Unchanged View Storybook View Build 2025-12-23 06:28:00

@github-actions
Copy link

github-actions bot commented Dec 23, 2025

📊 Coverage Report

Status Build Log Updated (UTC)
✅ Ready View Build 2025-12-23 06:27:40

📈 #229main에 병합하면 coverage가 3.79% 증가합니다.

Coverage 요약

@@             Coverage Diff             @@
##             main     #229       +/-   ##
===========================================
+ Coverage   34.65%   38.44%    +3.79%     
===========================================
  Files         164      164         0     
  Lines        7238     7238         0     
  Branches      255      300       +45     
===========================================
+ Hits         2508     2783      +275     
- Misses       4730     4455      -275     

영향받은 파일

파일 Coverage 변화
/home/runner/work/WeGo_FrontEnd/WeGo_FrontEnd/src/components/pages/user/profile/profile-edit-fields/image-field/index.tsx 100.00% (+77.78%) ⬆️
/home/runner/work/WeGo_FrontEnd/WeGo_FrontEnd/src/components/pages/user/profile/profile-edit-fields/mbti-field/index.tsx 100.00% (+75.68%) ⬆️
/home/runner/work/WeGo_FrontEnd/WeGo_FrontEnd/src/components/pages/user/profile/profile-edit-fields/message-field/index.tsx 100.00% (+65.39%) ⬆️
/home/runner/work/WeGo_FrontEnd/WeGo_FrontEnd/src/components/pages/user/profile/profile-edit-fields/nickname-field/index.tsx 100.00% (+68.97%) ⬆️
/home/runner/work/WeGo_FrontEnd/WeGo_FrontEnd/src/components/pages/user/profile/profile-edit-modal/index.tsx 68.57% (+47.15%) ⬆️
/home/runner/work/WeGo_FrontEnd/WeGo_FrontEnd/src/components/ui/hint/index.tsx 100.00% (+58.83%) ⬆️
/home/runner/work/WeGo_FrontEnd/WeGo_FrontEnd/src/components/ui/imageinput/index.tsx 52.02% (+36.48%) ⬆️
/home/runner/work/WeGo_FrontEnd/WeGo_FrontEnd/src/components/ui/label/index.tsx 100.00% (+63.16%) ⬆️
/home/runner/work/WeGo_FrontEnd/WeGo_FrontEnd/src/hooks/use-user/use-user-image-update/index.ts 88.23% (+47.06%) ⬆️
/home/runner/work/WeGo_FrontEnd/WeGo_FrontEnd/src/hooks/use-user/use-user-update/index.ts 88.23% (+47.06%) ⬆️
/home/runner/work/WeGo_FrontEnd/WeGo_FrontEnd/src/lib/schema/mypage.ts 100.00% (+27.78%) ⬆️

@Chiman2937 Chiman2937 added the Ready For Review! 리뷰 받을 준비가 되었습니다. label Dec 23, 2025
@Chiman2937
Copy link
Member Author

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 23, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
src/components/pages/user/profile/profile-edit-modal/index.test.tsx (1)

24-37: 타입 안정성을 개선할 수 있습니다.

renderResult 변수가 act() 블록 내에서만 할당되어 TypeScript가 undefined 가능성을 추론할 수 있습니다.

🔎 타입 안정성 개선 제안
 const renderWithProviders = async (component: React.ReactElement) => {
   const testQueryClient = createTestQueryClient();
-  let renderResult;
+  let renderResult!: ReturnType<typeof render>;
 
   await act(async () => {
     renderResult = render(
📜 Review details

Configuration used: Path: .coderabbit.yml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eee109b and ce29032.

📒 Files selected for processing (2)
  • src/components/pages/user/profile/profile-edit-modal/index.test.tsx
  • src/lib/schema/mypage.ts
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-12-17T09:40:37.733Z
Learnt from: HopeFullee
Repo: WeGo-Together/WeGo_FrontEnd PR: 205
File: src/components/pages/post-meetup/fields/cap-field/index.tsx:47-47
Timestamp: 2025-12-17T09:40:37.733Z
Learning: In TanStack Form with Zod validation, when field.state.meta.isValid is false, field.state.meta.errors is guaranteed to have at least one entry. Therefore, in an isInvalid check defined as field.state.meta.isTouched && !field.state.meta.isValid, safely access field.state.meta.errors[0] without extra null/empty checks. This guideline applies to TSX form fields under src/components/pages (and similar forms using the same pattern).

Applied to files:

  • src/components/pages/user/profile/profile-edit-modal/index.test.tsx
🧬 Code graph analysis (1)
src/components/pages/user/profile/profile-edit-modal/index.test.tsx (2)
src/mock/service/user/user-mock.ts (1)
  • mockUserItems (3-52)
src/mock/server.ts (1)
  • server (5-5)
🔇 Additional comments (6)
src/components/pages/user/profile/profile-edit-modal/index.test.tsx (5)

39-52: 테스트 설정이 올바르게 구성되었습니다.

MSW 서버의 라이프사이클 관리가 표준 패턴을 따르고 있습니다.


54-70: 렌더링 테스트가 적절합니다.

모달의 기본 렌더링과 초기값 설정을 올바르게 검증하고 있습니다.


72-105: 필드 입력 테스트가 잘 작성되었습니다.

사용자 상호작용 시뮬레이션이 적절하고 일관된 패턴을 따릅니다.


136-218: 유효성 검사 테스트가 철저합니다.

프로필 메시지와 MBTI 검증 테스트가 다양한 시나리오를 잘 커버하고 있습니다. 특히 MBTI 검증의 경우 onChange/onBlur 타이밍, 대소문자 처리, 부분 입력 등을 세밀하게 테스트하고 있어 우수합니다.


220-255: 제출 버튼 상태 테스트가 적절합니다.

유효성 검사 결과에 따른 버튼 활성화/비활성화 로직을 올바르게 검증하고 있습니다.

src/lib/schema/mypage.ts (1)

27-27: 에러 메시지 일관성 개선이 적절합니다.

Zod v4에서 message 파라미터는 deprecated이지만 여전히 지원됩니다. 현재 코드의 { message: '...' } 구문은 올바르게 작동합니다. 다만 Zod v4의 권장 사항은 message 대신 error 파라미터를 사용하는 것입니다. MBTI 검증 에러 메시지를 통일하는 것은 좋은 변경사항이므로, 향후 { error: '...' } 구문으로 마이그레이션할 수 있습니다.

Copy link
Contributor

@wooktori wooktori left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!

Comment on lines +73 to +82
test('닉네임 입력이 정상적으로 동작한다.', async () => {
const user = userEvent.setup();
await renderWithProviders(<ProfileEditModal user={mockUser} />);

const nickNameInput = screen.getByDisplayValue(mockUser.nickName);
await user.clear(nickNameInput);
await user.type(nickNameInput, '새로운 닉네임');

expect(nickNameInput).toHaveValue('새로운 닉네임');
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

userEvent를 사용해서 테스트 흐름이 뭔가 한눈에 잘 들어오는 것 같아요!
사용자가 테스트 하는 걸 실제로 보는 것 같은 느낌..?

@Chiman2937 Chiman2937 merged commit c47b196 into main Dec 23, 2025
12 checks passed
@Chiman2937 Chiman2937 deleted the chiyoung-feat/mypage-edit-test branch December 23, 2025 06:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Ready For Review! 리뷰 받을 준비가 되었습니다.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants