- Mastering React Test:Driven Development
- Daniel Irvine
- 189字
- 2021-06-24 14:45:02
Displaying data with your first test
In this section, we'll discover the TDD cycle for the first time.
We'll start our application by building out an appointment view. We won't get very far; the tests we'll create in this chapter will simply display the customer who made the appointment. As we do so, we'll discuss the TDD process in detail.
We'll build a React functional component called Appointment. It is used for displaying the details of a single appointment in our system. The component will be passed in a data structure that represents Appointment, which we can imagine looks a little something like this:
{
customer: { firstName: 'Ashley', lastName: 'Jones', phoneNumber: '(123) 555-0123' },
stylist: 'Jay Speares',
startsAt: '2019-02-02 09:30',
service: 'Cut',
notes: ''
}
We won't manage to get all of that information displayed by the time we complete the chapter; in fact, we'll only display the customer's firstName, and we'll make use of the startsAt timestamp to order a list of today's appointments.
But before we get on to that, let's explore Jest a little.
- 控糖控脂健康餐
- Python Deep Learning
- WSO2 Developer’s Guide
- Java軟件開發基礎
- ASP.NET 3.5程序設計與項目實踐
- Ext JS 4 Web Application Development Cookbook
- Visual Basic程序設計
- Node Cookbook(Second Edition)
- C專家編程
- Node學習指南(第2版)
- 細說Python編程:從入門到科學計算
- 軟件測試綜合技術
- 從Excel到Python數據分析:Pandas、xlwings、openpyxl、Matplotlib的交互與應用
- Django Design Patterns and Best Practices
- 零基礎看圖學ScratchJr:少兒趣味編程(全彩大字版)