Exercises
The following are some exercises for you to try out:
- Add a
toBeElementWithTagmatcher that replaces the two expectations in therenders as a select boxtest. It should be used like so:expect(field("service")).toBeElementWithTag("select"); - Complete the remaining tests for the
AppointmentFormselect 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
testPropsobject. - Update the
AppointmentsDayViewcomponent so that it uses thetodayAtbuilder, where appropriate. - Add the ability to choose a stylist before choosing a time slot. This...