MM-69835 Convert remaining Enzyme tests to RTL - #8
Conversation
|
@coderabbitai If possible, review this |
|
✅ Action performedReview finished.
|
|
|
📝 WalkthroughWalkthroughThe test suite migrates from Enzyme to React Testing Library. Shared DOM assertion helpers and controlled interaction fixtures replace Enzyme APIs. Enzyme dependencies are removed, and Karma uses ChromeHeadless by default. ChangesReact Testing Library migration
Estimated code review effort: 3 (Moderate) | ~25 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/MenuItemSpec.js`:
- Around line 148-155: Update the tests in MenuItemSpec.js to verify behavior
rather than checking the absent onselect attribute: use a callback spy and
dispatch the appropriate selection event to assert onSelect is invoked, and use
a separate onClick callback for click behavior. Remove the duplicated
onSelect-based click test while preserving coverage that internal props do not
leak and click handlers are called.
In `@test/SafeAnchorSpec.js`:
- Around line 85-89: Update the disabled-link test around SafeAnchor.handleClick
to verify propagation is stopped, not only that the component’s onClick prop is
skipped. Render SafeAnchor inside a parent with a separate onClick spy, trigger
the disabled click, and assert the parent spy was not called while preserving
the existing defaultPrevented and clickSpy assertions.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: a85dd4e7-c6dc-40da-a5ff-f545210fb695
⛔ Files ignored due to path filters (1)
yarn.lockis excluded by!**/yarn.lock,!**/*.lock
📒 Files selected for processing (20)
karma.conf.jspackage.jsontest/CheckboxSpec.jstest/ControlLabelSpec.jstest/FormControlFeedbackSpec.jstest/FormControlSpec.jstest/FormControlStaticSpec.jstest/FormSpec.jstest/HelpBlockSpec.jstest/InputGroupSpec.jstest/MenuItemSpec.jstest/NavSpec.jstest/PanelGroupSpec.jstest/PanelSpec.jstest/RadioSpec.jstest/SafeAnchorSpec.jstest/TabContainerSpec.jstest/ToggleButtonGroupSpec.jstest/helpers.jstest/index.js
💤 Files with no reviewable changes (1)
- package.json
Summary
This is the first part of updating to React 19 by finally getting rid of Enzyme in the tests for React Bootstrap. This was done primarily using Claude
Ticket Link
https://mattermost.atlassian.net/browse/MM-69835