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

Finishing off the form with a submit button

It's a good time to add a submit button and perform a manual test to check what you've created. A submit button test is relatively simple. Add the following test to your test file:

it('has a submit button', () => {
render(<CustomerForm />);
const submitButton = container.querySelector(
'input[type="submit"]'
);
expect(submitButton).not.toBeNull();
});

Then, make that pass by adding in your submit button into the form, at the bottom:

<form id="customer" onSubmit={handleSubmit}>
...
<input type="submit" value="Add" />
</form>

Update your entrypoint in src/index.js to render a new CustomerForm instance, rather than an AppointmentsDayView, and you should be ready to manually test:

主站蜘蛛池模板: 额济纳旗| 大庆市| 昭觉县| 绥滨县| 溧阳市| 巴彦县| 长寿区| 浪卡子县| 巧家县| 库车县| 定襄县| 江山市| 宕昌县| 商洛市| 砀山县| 莒南县| 万年县| 盐城市| 普定县| 绥芬河市| 乐昌市| 井研县| 进贤县| 新宾| 贡觉县| 大埔区| 安义县| 元谋县| 雷波县| 饶阳县| 连平县| 桃江县| 巴中市| 柞水县| 天峻县| 浦城县| 汶川县| 莱州市| 贺州市| 安丘市| 峨眉山市|