~/talk

Using React Testing Library to Write Stronger Tests

Talkat React Boston 2019 · 2019-09-21..09-22· [testing, react]
slides:none on file

Argues that switching from enzyme to react-testing-library stops brittle, white‑box tests and forces tests to exercise only the render output and DOM interactions; demos using fireEvent, getByLabelText and getByTitle, plus the toHaveStyle matcher to assert theme colors. Shows testing hooks, controlled vs uncontrolled components, redux and i18n providers, and a persisted theme that survives unmount/rerender by recreating the store. Notes a prior 100% coverage suite that constantly broke and how the new approach fixes that.

AI-written summary · about

  1. 0:00Introduction
  2. 0:35My history of tests
  3. 1:53Controlling vs Uncontrolled Components
  4. 4:47React Testing Library
  5. 5:36What is React Testing
  6. 6:07What React Testing Library Encourages
  7. 9:06Real World Example
  8. 10:17User Representation
  9. 14:12RealWorld Example
~/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.