Exercises
The following are some exercises for you to try out:
- Add a
toBeElementWithTag
matcher that replaces the two expectations in therenders as a select box
test. It should be used like so:expect(field("service")).toBeElementWithTag("select");
- Complete the remaining tests for the
AppointmentForm
select box:- Renders a label
- Assigns an ID that matches the label ID
- Saves an existing value when submitted
- Saves a new value when submitted
These tests are practically the same as they were for CustomerForm
, including the use of the change
helper. If you want a challenge, you can try extracting these form test helpers into a module of their own that is shared between CustomerForm
and AppointmentForm
.
- Update the time slot table tests so that they use the
testProps
object. - Update the
AppointmentsDayView
component so that it uses thetodayAt
builder, where appropriate. - Add the ability to choose a stylist before choosing a time slot. This...