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

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:

主站蜘蛛池模板: 仪陇县| 武清区| 侯马市| 凤山县| 都昌县| 威海市| 特克斯县| 应城市| 无锡市| 淮南市| 枣庄市| 城市| 镇安县| 闸北区| 泸州市| 平阴县| 太仆寺旗| 邳州市| 蕉岭县| 福州市| 普兰县| 美姑县| 寿光市| 当阳市| 出国| 兴业县| 蒙自县| 平顶山市| 通道| 泰州市| 突泉县| 宁安市| 游戏| 辽宁省| 武隆县| 岳阳县| 海门市| 中卫市| 当雄县| 昭苏县| 平塘县|