May 2019
Intermediate to advanced
496 pages
10h 38m
English
In order to make this test pass, we'll have to write some code above the expectation that will call into our production code.
Since we're testing what happens when a React component is rendered, we'll need to call the ReactDOM.render function. This function takes a component (which in our case will be called Appointment), performs the React render magic, and replaces an existing DOM node with the newly rendered node tree. The DOM node it replaces is known as the React container.
Here's the method signature:
ReactDOM.render(component, container)
In order to call this in our test, we'll need to define both component and container. Let's piece the test together before we write it out in full. It will have this shape: ...
Read now
Unlock full access