test(cloud): mock ad accounts as active in credit-reconciliation suite — un-red develop after #11619 gate - #11715
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI 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 |
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
…e — un-red develop after #11619 gate #11619 gated updateCampaign on account.status === "active" but did not update the ad-campaign-credit-reconciliation mocks, which stub adAccountsRepository.findById without a status field. Since that merge, 7 of the suite's 13 tests fail on develop with 'Ad account is not active (status: undefined)' before ever reaching the credit logic under test. Mark both beforeEach account mocks active so the suite exercises hold reconciliation again; the gate itself stays covered by ad-account-approval.test.ts (15 tests). Before: 6 pass / 7 fail. After: 13 pass / 0 fail (48/0 across the four ad suites). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
96f1849 to
a8f0b15
Compare
There was a problem hiding this comment.
Your trial has ended. Reactivate Greptile to resume code reviews.
|
Validation after rebase onto current
Checks run:
No approval from me because this PR is self-authored by lalalune. |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
What
#11619 gated
updateCampaignonaccount.status === "active"(closing the suspended-account spend leg from #11364) but did not update the mocks inpackages/cloud/shared/src/lib/services/__tests__/ad-campaign-credit-reconciliation.test.ts, which stubadAccountsRepository.findByIdwithout astatusfield.Since that merge, 7 of the suite's 13 tests fail on develop with:
— the gate throws before the credit-hold reconciliation logic under test is ever reached.
Fix
Add
status: "active"to the twobeforeEachaccount mocks so the suite exercises budget-change hold reconciliation again. The approval gate itself remains covered byad-account-approval.test.ts(15 tests, unchanged).Evidence
On
origin/develop@80ba667fd0(pre-fix):With this fix (same base):
Frontend/video/screenshot/trajectory evidence: N/A — test-only change to existing unit-test mocks; no runtime surface.
🤖 Generated with Claude Code