官术网_书友最值得收藏!

Displaying data with your first test

The Git tag for this section is appointment-first-name.

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.

主站蜘蛛池模板: 西峡县| 兰考县| 罗田县| 龙口市| 城口县| 抚松县| 天门市| 招远市| 紫金县| 胶州市| 东阿县| 奉节县| 新宁县| 东兴市| 图们市| 龙泉市| 马鞍山市| 金溪县| 华宁县| 屏山县| 烟台市| 承德县| 卢龙县| 万山特区| 渝北区| 塔城市| 木兰县| 昌宁县| 张北县| 临潭县| 宁乡县| 肇州县| 拉孜县| 赤壁市| 肃北| 阳信县| 拉萨市| 阿巴嘎旗| 沙坪坝区| 文水县| 景德镇市|