fix(tests): 테스트 타깃 전면 복구 + 앱 아이콘 배지 의존성 분리 - #142
Open
rrheon wants to merge 1 commit into
Open
Conversation
테스트 타깃이 컴파일 에러로 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
요약
MongleFeaturesTests타깃이 컴파일 에러로 테스트 0개 실행 상태였던 것을 48/48 통과로 복구합니다. 근본 원인 중 하나가 프로덕션 코드(리듀서의 UNUserNotificationCenter 직접 호출)라 의존성 분리 리팩토링을 포함합니다.변경 내용
1. 앱 아이콘 배지 의존성 분리 (프로덕션)
UNUserNotificationCenter.current().setBadgeCount()를 직접 호출 → 호스트 앱 없는 테스트 러너에서bundleProxyForCurrentProcess nil크래시 + 테스트에서 스텁 불가DependencyValues.setAppIconBadge신설 (liveValue = setBadgeCount, testValue = no-op)NotificationFeature.syncAppIconBadge5곳 +Root+ReducerloadDataResponse 배지 이펙트 (동작 동일)2. 테스트 drift 수정
NotificationSection튜플→구조체 반영(.0/.1→.title/.items, 컴파일 에러 원인). 파생 상태 캐시(groupedNotifications/unreadCount) 갱신을 기대치에 반영 —refreshDerivedinternal 화onAppear가isLoadingGroups를 만지지 않는 현행 동작(Root 담당, 레이스 수정분) 반영refreshHomeData이펙트가 접근하는 리포지토리 5종(Auth/Family/Question/Answer/User) 스로잉 스텁 추가·주입검증
xcodebuild test(MongleFeatures 패키지): 48개 테스트 0 실패🤖 Generated with Claude Code