- 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.
- Azure IoT Development Cookbook
- 構建移動網站與APP:HTML 5移動開發入門與實戰(跨平臺移動開發叢書)
- Mastering PHP Design Patterns
- Learning AWS Lumberyard Game Development
- Implementing Cisco Networking Solutions
- 人人都是網站分析師:從分析師的視角理解網站和解讀數據
- ASP.NET開發與應用教程
- 21天學通C++(第5版)
- Modern C++ Programming Cookbook
- Elasticsearch Essentials
- Moodle 3 Administration(Third Edition)
- Deep Learning for Natural Language Processing
- Mastering ASP.NET Core 2.0
- C# 7.1 and .NET Core 2.0:Modern Cross-Platform Development(Third Edition)
- Java Web開發基礎與案例教程