- 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?
推薦閱讀
- JSP網(wǎng)絡(luò)編程(學(xué)習(xí)筆記)
- Learn Type:Driven Development
- Java面向?qū)ο蟪绦蛟O(shè)計(jì)
- C/C++數(shù)據(jù)結(jié)構(gòu)與算法速學(xué)速用大辭典
- Python商務(wù)數(shù)據(jù)分析(微課版)
- Simulation for Data Science with R
- HTML5移動(dòng)前端開發(fā)基礎(chǔ)與實(shí)戰(zhàn)(微課版)
- 從零開始學(xué)Python大數(shù)據(jù)與量化交易
- Flink入門與實(shí)戰(zhàn)
- Learning Alfresco Web Scripts
- AI輔助編程Python實(shí)戰(zhàn):基于GitHub Copilot和ChatGPT
- Unity虛擬現(xiàn)實(shí)開發(fā)圣典
- 數(shù)據(jù)庫(kù)技術(shù)及應(yīng)用教程上機(jī)指導(dǎo)與習(xí)題(第2版)
- 計(jì)算機(jī)信息技術(shù)實(shí)踐教程
- 算法技術(shù)手冊(cè)