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

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:

主站蜘蛛池模板: 温州市| 循化| 康保县| 平利县| 台北县| 永嘉县| 米泉市| 东港市| 化隆| 甘洛县| 高雄县| 青州市| 柘城县| 贵溪市| 东山县| 沂源县| 兴国县| 望城县| 贺兰县| 城固县| 富宁县| 呈贡县| 湖州市| 宣汉县| 明光市| 丰原市| 罗甸县| 江陵县| 四川省| 上思县| 广德县| 噶尔县| 安丘市| 饶阳县| 崇州市| 巴马| 安远县| 琼结县| 封丘县| 西吉县| 姜堰市|