- Mastering React Test:Driven Development
- Daniel Irvine
- 173字
- 2021-06-24 14:45:06
Exercises
The Git tag for this section is chapter-1-exercises.
- Rename Appointment.js and Appointment.test.js to AppointmentsDayView.js and AppointmentsDayView.test.js. While it's fine to include multiple components in one file if they form a hierarchy, you should always name the file after the root component for that hierarchy.
- Complete the Appointment component by displaying the following fields on the page. You should use a table HTML element to give the data some visual structure. This shouldn't affect how you write your tests:
- Customer last name, using the lastName field
- Customer telephone number, using the phoneNumber field
- Stylist name, using the stylist field
- Salon service, using the service field
- Appointment notes, using the notes field
- Add a heading to Appointment to make it clear which appointment time is being viewed.
- There is some repeated sample data. We've used sample data in our tests and we also have sampleAppointments in src/sampleData.js, which we used to manually test our application. Do you think it is worth drying this up? If so, why? If not, why not?
推薦閱讀
- Learning Apache Mahout Classification
- 全棧自動化測試實戰:基于TestNG、HttpClient、Selenium和Appium
- 愛上C語言:C KISS
- 深入分析GCC
- Python 快速入門(第3版)
- 從零開始構建深度前饋神經網絡:Python+TensorFlow 2.x
- Manage Your SAP Projects with SAP Activate
- Mastering Node.js
- C# 10核心技術指南
- SEO的藝術(原書第2版)
- Python輕松學:爬蟲、游戲與架站
- Swift 5從零到精通iOS開發訓練營
- Python機器學習技術:模型關系管理
- Java EE 8 Development with Eclipse
- Go語言從入門到項目實戰(視頻版)