test: 完善测试覆盖,新增 121 个测试用例#43
Conversation
- helper.test.ts: add tests for cn(), promiseAny(), patchSearchParams(), ManageAppDrawerPlacement, ManageAppDrawerCollapsed, and boundary cases for isPasswordValid/isValidExternalUrl/isExpVersion - billing.test.ts: add tests for resolveMonthlyPriceFactor(), resolveMonthlyPrice(), parseBillingMonths(), and edge cases for resolveBillingPlan/getAnnualSavings/getBillingOptions - hooks.test.tsx: add 15 tests for getPackageTimestampWarnings() pure function (empty inputs, dedup, sorting, underscore names, ignored timestamps) plus cooldown edge cases (invalid/negative values, other storage keys) - query-keys.test.ts: new file testing versionKeys factory (byApp, page, all, key isolation) Total: 47 → 168 tests
✅ Deploy Preview for pushy ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR adds comprehensive unit test coverage across four utility modules. The changes expand existing test suites for billing, helper, and hooks utilities with edge cases and boundary conditions, and introduce a new test suite for query key builders—totaling +1,010 new lines of test code with zero modifications to production code. ChangesTest Coverage Expansion
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 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 |
Summary
为 pushy-admin 项目新增全面的单元测试,测试总数从 47 增加到 168(新增 121 个)。
新增/扩展的测试文件
src/utils/helper.test.ts (+30 tests)
src/utils/billing.test.ts (+36 tests)
src/utils/hooks.test.tsx (+15 tests)
src/utils/query-keys.test.ts (new, 12 tests)
Summary by CodeRabbit