May 2019
Intermediate to advanced
496 pages
10h 38m
English
Now that we have our table with headings in place, it's time to add in radio buttons into each of the table cells. Not all cells will have radio buttons: only those that represent an available time slot will have a radio button.
That means we'll need to pass in another new prop to AppointmentForm that will help us to determine which time slots to show. That prop is availableTimeSlots, which is an array of objects that list times that are still available.
Add this next test, which uses that prop:
it('renders a radio button for each time slot', () => { const today = new Date(); const availableTimeSlots = [ { startsAt: today.setHours(9, ...Read now
Unlock full access