Testing implementation details
Implementation details include the component state's current value or explicitly invoking a method attached to a button in the DOM. Implementation details are the under-the-hood parts of components abstracted away from the user when they use the component. As an analogy, we can think of the experience of driving a car. To move, you must use the key to start the car, put the car into drive, and press the gas pedal. You don't need to know how everything is wired together in the engine under the vehicle's hood. You probably do not even care. All you care about is that you can drive the car when you perform the behaviors mentioned.
In this section, you will explore the disadvantages of focusing on implementation details in your tests. We will show you examples of tests with implementation details. Finally, you will learn how to shift your focus away from thinking about implementation details when testing.