~/talk

Testable React Components

Talkat React Rally 2015 · 2015-08-24..08-25· [react, testing]
name:Julia Gao
links:none on file
slides:none on file

Concrete rules for making React components testable: separate concerns so AJAX lives in a thin fetch component and UI is props driven not state driven, mock network/auth during unit tests, and render with TestUtils using scry vs find and call getDOMNode before DOM APIs. Tests use TestUtils.simulate for events and Karma with coverage reporting shows per-line hits and color thresholds. Common failures include missing props, multiple inputs breaking find, and getAttribute errors when interacting with non-DOM nodes.

AI-written summary · about

  1. 0:00Start
  2. 1:13Why Testing Front-End
  3. 2:09Tools
  4. 7:53Props
  5. 10:29Takeaways!
  6. 13:02Setup in karma.conf.js
~/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.