Choosing a value from a select box
Let’s start by creating a component for booking new appointments, named AppointmentForm
.
The first field is a select box for choosing which service the customer requires: cut, color, blow-dry, and so on. Let’s create that now:
- Create a new file,
test/AppointmentForm.test.js
, with the following test and setup:import React from "react"; import { Â Â initializeReactContainer, Â Â render, Â Â field, Â Â form, } from "./reactTestExtensions"; import { AppointmentForm } from "../src/AppointmentForm"; describe("AppointmentForm", () => { Â Â beforeEach(() => { Â Â Â Â initializeReactContainer(); Â Â }); Â Â it("renders a form", () => { Â Â Â Â render(<AppointmentForm />); Â Â Â Â expect(form()).not.toBeNull(); Â Â }); });
- Make this test pass by implementing...