- 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?
推薦閱讀
- Extending Jenkins
- PyQt從入門(mén)到精通
- OpenStack Cloud Computing Cookbook(Fourth Edition)
- Mastering Scientific Computing with R
- Julia Cookbook
- SQL Server 2016數(shù)據(jù)庫(kù)應(yīng)用與開(kāi)發(fā)習(xí)題解答與上機(jī)指導(dǎo)
- 快速念咒:MySQL入門(mén)指南與進(jìn)階實(shí)戰(zhàn)
- Modular Programming in Java 9
- The Professional ScrumMaster’s Handbook
- Geospatial Development By Example with Python
- Getting Started with Polymer
- 測(cè)試架構(gòu)師修煉之道:從測(cè)試工程師到測(cè)試架構(gòu)師
- Qt 4開(kāi)發(fā)實(shí)踐
- 奔跑吧 Linux內(nèi)核
- Mastering JavaScript