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

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.

主站蜘蛛池模板: 博爱县| 晴隆县| 乃东县| 泽州县| 尼玛县| 社旗县| 庆城县| 九寨沟县| 大理市| 惠州市| 同心县| 天长市| 临沧市| 乌恰县| 瓦房店市| 青冈县| 罗源县| 灵宝市| 塔河县| 天气| 乌鲁木齐县| 鄂托克旗| 衢州市| 长治县| 普洱| 泽库县| 华阴市| 宜州市| 固安县| 长寿区| 江源县| 湖南省| 屏东县| 武鸣县| 朝阳区| 株洲县| 凤山市| 新密市| 溧阳市| 新乐市| 武陟县|