Part 16 / Topic 6 of 9
A bigger worked restructure
Sections 1-5 each isolate one idea in one small file pair. examples/06_restructuring_example/ puts three related files through the same move at once, closer to what a real refactor looks like: a "before" flat layout - before/components/RestaurantCard.jsx, before/components/RestaurantList.jsx, before/hooks/useRestaurantFilter.js - restructured into one "after" feature folder, after/features/restaurants/, with the same three files as direct siblings. restructuring.test.jsx imports RestaurantList from both locations and runs the identical assertions against each with describe.each: filtering to "all" shows every restaurant, filtering to "north-indian" shows only the matching one - for the before version and the after version alike. The point is the same as Section 1's, just at the scale a real restructure actually happens at: moving three files that depend on each other into one folder is a pure location change a test suite should catch if it ever silently becomes a behavior change, and here it provably doesn't.
Done here? The practice set for Part 16 — including the solutions — is on the part page.