test(seller): SellerRepository spec 추가 (P2-1)#120
Conversation
기존 spec 부재 (커버리지 0%) 상태였던 SellerRepository (449줄 / 27 async + 3 export fn) 에 testcontainers/mysql 기반 real DB spec 추가. AuthRepository / UserRepository 의 spec 패턴 일관. 커버 범위: - account/store context (findSellerAccountContext, findStoreBySellerAccountId, findStoreOwnership, updateStore) - business hours (list, upsert — 신규/갱신) - special closure (create 신규/soft-delete 복구, update, findById ownership, softDelete, list cursor/limit) - daily capacity (create 신규/복구, update, findById ownership, softDelete, list fromDate/toDate 필터+cursor) - faq topic (list 정렬, create, findById ownership, update, softDelete) - banner (list link_store_id/link_product 양 경로 ownership, cursor/limit, findById ownership, create+update+softDelete) - audit log (actor OR storeId 매칭, targetType 필터, cursor/limit) - standalone fn: normalizeCursorInput (clamp/null), nextCursorOf, isSellerAccount 41 cases 추가. seller.repository.ts coverage 0/0/0/0 → 100/96.29/100/100.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Coverage report
Test suite run success1240 tests passing in 144 suites. Report generated by 🧪jest coverage report action from db47736 |
Summary
P2-1.
SellerRepository(449 줄 / 27 async + 3 export fn) 에 spec 부재 — coverage 0%. AuthRepository / UserRepository 와 같은 testcontainers/mysql 기반 real DB spec 추가로 정합.Scope
신규 파일 1 개:
src/features/seller/repositories/seller.repository.spec.ts(41 cases)그룹별 커버 범위
findSellerAccountContext,findStoreBySellerAccountId,findStoreOwnership,updateStorelistStoreBusinessHours,upsertStoreBusinessHourcreateStoreSpecialClosure(신규/soft-delete 복구),updateStoreSpecialClosure,findStoreSpecialClosureById,softDeleteStoreSpecialClosure,listStoreSpecialClosurescreateStoreDailyCapacity(신규/복구),updateStoreDailyCapacity,findStoreDailyCapacityById,softDeleteStoreDailyCapacity,listStoreDailyCapacitieslistFaqTopics,createFaqTopic,findFaqTopicById,updateFaqTopic,softDeleteFaqTopiclistBannersByStore,findBannerByIdForStore,createBanner,updateBanner,softDeleteBannerlistAuditLogsBySellernormalizeCursorInput,nextCursorOf,isSellerAccount패턴
createTestingModuleWithRealDb({ providers: [SellerRepository] })+truncateAll()매 케이스 격리 — AccountRepository spec 과 동일setupSellerWithStore,createAccount,createProduct,createStoreme+other두 seller setup 후 cross-store query 가 null 인지 확인 (B-1 정합성 가드와 같은 흐름)Impact
seller.repository.ts0/0/0/0 → 100/96.29/100/100 (미커버 line 438 은 defensive?? nullfallback 으로 자연 실행 불가)Test plan