Skip to content

fix(tests): 테스트 타깃 전면 복구 + 앱 아이콘 배지 의존성 분리 - #142

Open
rrheon wants to merge 1 commit into
mainfrom
fix/test-target-badge-dependency
Open

fix(tests): 테스트 타깃 전면 복구 + 앱 아이콘 배지 의존성 분리#142
rrheon wants to merge 1 commit into
mainfrom
fix/test-target-badge-dependency

Conversation

@rrheon

@rrheon rrheon commented Jul 9, 2026

Copy link
Copy Markdown
Owner

요약

MongleFeaturesTests 타깃이 컴파일 에러로 테스트 0개 실행 상태였던 것을 48/48 통과로 복구합니다. 근본 원인 중 하나가 프로덕션 코드(리듀서의 UNUserNotificationCenter 직접 호출)라 의존성 분리 리팩토링을 포함합니다.

변경 내용

1. 앱 아이콘 배지 의존성 분리 (프로덕션)

  • 리듀서가 UNUserNotificationCenter.current().setBadgeCount() 를 직접 호출 → 호스트 앱 없는 테스트 러너에서 bundleProxyForCurrentProcess nil 크래시 + 테스트에서 스텁 불가
  • DependencyValues.setAppIconBadge 신설 (liveValue = setBadgeCount, testValue = no-op)
  • 호출부 교체: NotificationFeature.syncAppIconBadge 5곳 + Root+Reducer loadDataResponse 배지 이펙트 (동작 동일)

2. 테스트 drift 수정

  • NotificationFeatureTests: NotificationSection 튜플→구조체 반영(.0/.1.title/.items, 컴파일 에러 원인). 파생 상태 캐시(groupedNotifications/unreadCount) 갱신을 기대치에 반영 — refreshDerived internal 화
  • GroupSelectFeatureTests: onAppearisLoadingGroups 를 만지지 않는 현행 동작(Root 담당, 레이스 수정분) 반영
  • RootFeatureTests: refreshHomeData 이펙트가 접근하는 리포지토리 5종(Auth/Family/Question/Answer/User) 스로잉 스텁 추가·주입

검증

  • xcodebuild test (MongleFeatures 패키지): 48개 테스트 0 실패
  • 앱 스킴 Debug 빌드: BUILD SUCCEEDED

🤖 Generated with Claude Code

테스트 타깃이 컴파일 에러로 0개 실행 상태였던 것을 49/49 통과로 복구.

1) 배지 의존성 분리 (프로덕션 수정, 근본 원인):
- 리듀서가 UNUserNotificationCenter.current() 를 직접 호출 → 호스트 앱 없는
  테스트 러너에서 bundleProxyForCurrentProcess nil 크래시 + 스텁 불가
- DependencyValues.setAppIconBadge (@sendable (Int) async -> Void) 신설,
  liveValue = setBadgeCount / testValue = no-op
- NotificationFeature.syncAppIconBadge 5개 호출부 + Root+Reducer
  loadDataResponse 배지 이펙트를 의존성 경유로 교체 (동작 동일)

2) 테스트 drift 수정:
- NotificationFeatureTests: NotificationSection 튜플→구조체 변경 반영
  (.0/.1 → .title/.items — 컴파일 에러의 직접 원인), 파생 상태
  (groupedNotifications/unreadCount) 갱신을 기대치에 반영 —
  refreshDerived 를 internal 로 열어 리듀서와 동일 로직으로 계산
- GroupSelectFeatureTests: onAppear 가 isLoadingGroups 를 만지지 않는
  현행 동작(Root 담당, 레이스 수정) 반영
- RootFeatureTests: refreshHomeData 이펙트가 접근하는 리포지토리 5종
  (Auth/Family/Question/Answer/User) 스로잉 스텁을 TestHelpers 에 추가·주입

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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