~/talk

Discovering Testing Library for React

TalkinFrenchat Devoxx France 2021 · 2021-09-29..10-01· [testing, react]
links:none on file
slides:none on file

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

  1. 0:00Introduction
  2. 1:26Pokédex overview
  3. 2:30Render and selection functions
  4. 3:56Role selection and accessibility
  5. 6:03Handling missing elements
  6. 7:09Multiple selection with getAllBy
  7. 8:38Other selection methods
  8. 9:23Interactions with userEvent
  9. 11:10fireEvent vs userEvent
  10. 12:13Async tests with findBy
  11. 13:38Feature summary
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.