- Mastering React Test:Driven Development
- Daniel Irvine
- 108字
- 2021-06-24 14:45:05
Selecting data to view
Let's add in some dynamic behavior to our page. We'll make each of the list items a link that the user can click on to view that appointment.
Thinking through our design a little, there are a few pieces we'll need:
- A button element within our li
- An onClick handler that is attached to that button element
- A component state to record which appointment is currently being viewed
When we test React actions, we do it by observing the consequences of those actions. In this case, we can click on a button and then check that its corresponding appointment is now rendered on screen.
推薦閱讀
- 匯編語言程序設計(第2版)
- Blender 3D Incredible Machines
- 名師講壇:Spring實戰開發(Redis+SpringDataJPA+SpringMVC+SpringSecurity)
- HTML5從入門到精通 (第2版)
- Mastering Android Game Development
- 軟件測試實用教程
- MySQL入門很輕松(微課超值版)
- C專家編程
- Learning Hadoop 2
- Mastering Adobe Captivate 7
- TypeScript圖形渲染實戰:2D架構設計與實現
- 測試工程師Python開發實戰
- 樹莓派開發從零開始學:超好玩的智能小硬件制作書
- 程序員的算法趣題2
- C++ Game Development Cookbook