Rewrite admin, announcement and shared-primitive test suites with React Testing Library#321
Rewrite admin, announcement and shared-primitive test suites with React Testing Library#321jonathangreen wants to merge 1 commit into
Conversation
|
Claude finished @jonathangreen's task in 5m 21s —— View job Code Review
SummaryThis is a clean, faithful enzyme→RTL migration. I read all 12 suites and cross-checked the trickiest ones ( |
Greptile SummaryThis PR moves several legacy Enzyme component suites to React Testing Library. The main changes are:
Confidence Score: 5/5This looks safe to merge.
Important Files Changed
Reviews (2): Last reviewed commit: "Rewrite admin, announcement and shared-p..." | Re-trigger Greptile |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #321 +/- ##
==========================================
+ Coverage 90.14% 90.28% +0.14%
==========================================
Files 205 205
Lines 7610 7610
Branches 1664 1664
==========================================
+ Hits 6860 6871 +11
+ Misses 437 430 -7
+ Partials 313 309 -4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…ct Testing Library
837f28a to
900ed9f
Compare
Description
Rewrites the admin, discovery, announcement, and shared form/presentational primitive test suites with React Testing Library.
Migrated suites (old enzyme test in
src/components/__tests__/removed, RTL test added/expanded intests/jest/components/):Migration notes (carried over from #316, for the suites in this PR):
EditableInput.prototype.getValue,TextWithEditMode) become realuserEvent.typethat reads back through the component's ref API;state()/instance()reads become DOM assertions.EditableInputandIndividualAdminsmerge into existing jest suites rather than adding new files.DiscoveryServices,Header), it renders the connected default export somapStateToProps/mapDispatchToPropsstay covered.userEventusage follows theconst user = userEvent.setup()convention used acrosstests/jest/.This is one of four PRs splitting the oversized #316 into independently reviewable pieces, grouped by feature area. Each split branches from
mainand touches a disjoint set of component test files, so the four can be reviewed and merged in any order.Motivation and Context
#316 rewrote the HARD-tier and remaining merge test suites from enzyme to React Testing Library in a single ~11k-line change, which is impractical to review. Splitting it by feature area keeps each PR at a reviewable size while preserving the same net result. These were among the hardest suites in the mocha/chai/enzyme → jest/RTL migration — enzyme mounted them and poked class internals, so the rewrites re-express those assertions as DOM and behavior checks.
How Has This Been Tested?
npx jest --selectProjects unitover the migrated suites on this branch: 12 suites / 153 tests pass. No application source changes — test files only.Checklist: