Add onClose cb and playground colors#20
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds a shared playground drawer slot for content styling, exposes a new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Review rate limit: 0/3 reviews remaining, refill in 50 minutes and 32 seconds. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/components/Drawer.tsx (1)
93-99: ⚡ Quick winAdd regression tests for
onClosetransition semantics.Please lock this behavior with tests for: (1) no call on initial
open=falsemount, and (2) exactly one call ontrue → falsein both controlled and uncontrolled flows.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/components/Drawer.tsx` around lines 93 - 99, Add regression tests for Drawer to assert onClose transition semantics: create tests referencing the Drawer component and its props (open, onCloseProp) and the internal wasOpenRef/useEffect behavior by (1) rendering Drawer with open={false} on initial mount and asserting onClose mock (jest.fn) is not called, and (2) asserting exactly one onClose call when changing from open=true to open=false in both controlled (pass open prop and rerender to false) and uncontrolled flows (render without open, simulate the user or prop path that closes the drawer) by using react-testing-library render/rerender (or fireEvent) inside act and verifying mock calls === 1. Ensure tests use rerender or user events to trigger the transition true → false and explicitly assert no extra calls.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/components/Drawer.tsx`:
- Around line 93-99: Add regression tests for Drawer to assert onClose
transition semantics: create tests referencing the Drawer component and its
props (open, onCloseProp) and the internal wasOpenRef/useEffect behavior by (1)
rendering Drawer with open={false} on initial mount and asserting onClose mock
(jest.fn) is not called, and (2) asserting exactly one onClose call when
changing from open=true to open=false in both controlled (pass open prop and
rerender to false) and uncontrolled flows (render without open, simulate the
user or prop path that closes the drawer) by using react-testing-library
render/rerender (or fireEvent) inside act and verifying mock calls === 1. Ensure
tests use rerender or user events to trigger the transition true → false and
explicitly assert no extra calls.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: eadadf64-488a-4f8e-b259-8402745bd2ee
📒 Files selected for processing (5)
playground/src/PlaygroundApp.tsxsrc/components/Drawer.tsxsrc/components/drawer/DrawerContent.tsxsrc/types.tssrc/utils.ts
e797764 to
af74279
Compare
Summary by CodeRabbit