Specifying list item content
In this section, you’ll add a test that uses an array of example appointments to specify that the list items should show the time of each appointment, and then you’ll use that test to support the implementation.
Let’s start with the test:
- Create a fourth test in the new
describe
block as shown:it("renders the time of each appointment", () => { const today = new Date(); const twoAppointments = [ { startsAt: today.setHours(12, 0) }, { startsAt: today.setHours(13, 0) }, ]; render( <AppointmentsDayView appointments={twoAppointments} /> ); const listChildren = document.querySelectorAll("li"); expect(listChildren[0].textContent).toEqual( ...