test: cover Escape tooltip integration - #543
Conversation
|
@nrps9909 is attempting to deploy a commit to the afc163's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review. Walkthrough新增集成测试。测试使用真实 ChangesTooltip Escape 关闭
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This change adds focused regression coverage without altering production behavior, and no actionable merge-blocking risk remains after normal checks and review. Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files. ✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 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. Additional details and impacted files@@ Coverage Diff @@
## master #543 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 3 3
Lines 38 38
Branches 15 15
=========================================
Hits 38 38 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
@rc-component/triggerdependency instead of Tooltip's manual Trigger mockCloses #510.
Why
Escape handling is implemented by the current Trigger/Portal stack, but Tooltip's regular unit tests resolve
@rc-component/triggerto the repository's manual mock. Those tests therefore cannot detect a dependency or wiring regression that makes an open Tooltip ignore Escape.The new test keeps the existing fast mocked suite intact and adds one focused cross-package boundary check. It opens an uncontrolled click Tooltip, verifies
onVisibleChange(true)and the visible popup, dispatches Escape on the owning window, then verifiesonVisibleChange(false)and the hidden popup.Causal validation
I temporarily disabled only Trigger's
onEschandoff to Portal in the installed dependency. The new test failed because the callback's last and only value remainedtrue. Restoring the exact dependency made it pass again. The temporary dependency edit was not committed.Verification
npm test -- --runInBand— 3 suites, 31 testsnpm run tscnpm run lint -- --max-warnings=100npx prettier --check tests/escape.integration.test.tsxnpm run compile— ESM, CJS, declarations, and both Less bundlesgit diff --checkAI assistance disclosure: Codex was used to trace the mocked and real dependency paths, prepare and causally reverse the integration regression, run validation, and draft this PR. I verified the final diff, signed commit, and all results above.
Summary by CodeRabbit