Testing React in a Right Way
summary
Argues for testing user interactions not implementation details and shows a small app with a checkbox and email field where naive snapshot or shallow Enzyme tests miss a validation bug. Uses Enzyme vs React Testing Library comparisons, demonstrates firing a change event on an input rather than manipulating internals, and runs Cypress for e2e in headless CI with screenshots. Claims unit tests for logic, integration tests for DOM interactions, and e2e to catch browser quirks and disabled-field regressions; shows the CI suite actually catches real failures.
AI-written summary · about
chapters (5)
- 0:00React testing intro
- 4:00Shallow rendering matters
- 7:57User interactions testing
- 13:09Headless testing
- 17:57Q&A
related talks
22mElizabeth Funk - An Introduction to React Testing Library
16mCrushing React bugs with Jest and Enzyme
41mUI and Unit Testing with Airbnb's Enzyme
24mUsing React Testing Library to Write Stronger Tests
30mTesting Front-End Applications
29mTesting Is All About Principles
53mTesting React Applications
06mJest & Enzyme-testing your React application
