test(api): inject resolveAccount into buildReshapeHandler (closes #192)#862
test(api): inject resolveAccount into buildReshapeHandler (closes #192)#862cristim wants to merge 1 commit into
Conversation
Accept resolveAccount as a 4th parameter (nil = unscoped default). Removes the post-construction override in the scoped-account test, making the "I want the scoped branch" intent a constructor param rather than an easy-to-forget mutation after construction. Closes #192
|
Warning Review limit reached
More reviews will be available in 36 minutes and 42 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
Summary
resolveAccount func(context.Context) (string, error)as a 4th parameter tobuildReshapeHandler(test helper only), withnildefaulting to the unscoped("", nil)resolver.nil.TestReshapeRecommendations_Integration_ScopedAccount_FiltersToAccountwith an inline constructor argument, making the scoped intent explicit and impossible to accidentally forget in future copy-pastes.Test plan
go build ./...passes (verified locally)grep -n "h.reshapeAccountResolver = " internal/api/handler_ri_exchange_integration_test.goreturns zero resultsgo test -tags=integration ./internal/api/...(requires Docker / testcontainers)