Exercises
Try the following exercises:
- Add a test to the
CustomerForm
test suite to specify that the error state is cleared when the form is submitted a second time with all validation errors corrected. - Update the
AppointmentForm
test suite to usejest.fn()
andjest.spyOn()
. - Extend
AppointmentForm
so that it submits an appointment using aPOST
request to/appointments
. The/appointments
endpoint returns a201 Created
response without a body, so you don’t need to calljson
on the response object or send back any parameters toonSave
.