May 2019
Intermediate to advanced
496 pages
10h 38m
English
The call to ReactDOM.render is the same in both methods. Since it's the same in both methods, it makes sense to pull it out.
However, rather than pull it out as-is, we can create a new function that takes the Appointment component as its parameter. This way, we can clearly see how our test data objects are woven through the object under test. If we hid that within an extracted method, the test would be less clear.
Above the first test, write the following ...
Read now
Unlock full access