If we write tests for our Vue components, we want them to be maintainable. Therefore, our tests should not include implementation details of our components.
The more your tests resemble the way your software is used, the more confidence they can give you.
So rather than dealing with instances of rendered Vue components, the tests will work with actual DOM nodes. The library provides methods to query the DOM the same way the user would. Users are looking for specific text or a button to click. They don’t look for the
nth child of a div with the class .button-container.
Let’s take a look at a simple example: