- 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.
- Java逍遙游記
- OpenCV實例精解
- 數據結構和算法基礎(Java語言實現)
- 算法零基礎一本通(Python版)
- PHP程序設計(慕課版)
- C語言程序設計實訓教程
- 前端架構:從入門到微前端
- Mastering macOS Programming
- Python機器學習實戰
- Hands-On GPU:Accelerated Computer Vision with OpenCV and CUDA
- Apache Mahout Clustering Designs
- Mastering Gephi Network Visualization
- SQL Server 2012 數據庫應用教程(第3版)
- Oracle Database XE 11gR2 Jump Start Guide
- 分布式數據庫HBase案例教程