Testing React Components
summary
A concrete experiment compares tight unit tests with loose unit tests on a login form that fetches and updates Redux state: starting tests are four files and 18 tests, then refactors move from connected Redux components to a setState form and finally to a generic form. The loose, user-facing tests survive without change; tight tests require many rewrites. Uses declarative “marks” to mock props state localStorage window size and API responses and recommends mocking data not internal modules.
AI-written summary · about








