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

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:

主站蜘蛛池模板: 宜兰县| 慈利县| 施甸县| 通榆县| 时尚| 清苑县| 齐齐哈尔市| 贺州市| 凤阳县| 涞源县| 汶川县| 平阴县| 平陆县| 灵台县| 聊城市| 腾冲县| 乐平市| 阜新市| 察雅县| 来宾市| 岳普湖县| 武胜县| 宜兰县| 扎兰屯市| 自治县| 通渭县| 专栏| 容城县| 苍南县| 洪江市| 牡丹江市| 德化县| 龙岩市| 商城县| 莱芜市| 凤庆县| 剑河县| 安岳县| 新建县| 通化市| 彭水|