Discovering Testing Library for React
summary
Demonstrates using React Testing Library (RTL) on a small CRA Pokédex app to show concrete workflows: render with getByText/getByRole for presence checks, queryBy/getAllBy for absence or multiple matches, and userEvent (vs fireEvent) to simulate clicks and typing. Shows an interaction that increments a Pokéball counter and exposes an async promise that requires findBy (or waitFor) to wait for DOM updates; all examples run in Create‑React‑App.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 1:26Pokédex overview
- 2:30Render and selection functions
- 3:56Role selection and accessibility
- 6:03Handling missing elements
- 7:09Multiple selection with getAllBy
- 8:38Other selection methods
- 9:23Interactions with userEvent
- 11:10fireEvent vs userEvent
- 12:13Async tests with findBy
- 13:38Feature summary
related talks
01h 00mTest Driving React Applications
30mTesting Library: everybody uses it, but nobody understands it
22mElizabeth Funk - An Introduction to React Testing Library
24mUsing React Testing Library to Write Stronger Tests
30mTesting React Applications
53mTesting React Applications
32mTesting Library Meets React Native
44mHow Well Do You Know React? let's have fun together!
