Summary
This chapter covered the final TDD technique for you to learn – mocked component callback props. You learned how to get a reference to a component callback using the propsOf
extension, as well as how to use a state variable to manage the transitions between different parts of a workflow.
You will have noticed how all the child components in App
were mocked out. This is often the case with top-level components, where each child component is a relatively complex, self-contained unit.
In the next part of this book, we’ll apply everything we’ve learned to more complex scenarios. We’ll start by introducing field validation into our CustomerForm
component.