Thanks, but I don't want to be dependant on the sp...
# vue
v
Thanks, but I don't want to be dependant on the specific submodule, or the specific implementation. Like if I swap out the subcomponent for something with, say a different style, I don't want my tests to break.
w
Could we get more specific, eg: I'm in Parent.spec.js and Parent renders Child. In the test for Parent, you want to confirm Child has been rendered, but not have any assertions about the nature of Child itself? You can use findComponent https://test-utils.vuejs.org/api/#findcomponent from the Vue Test Utils wrapper, it's available as
Cypress.vueWrapper.findComponent
But I'd find use cases for this to be pretty rare. The less my tests know about the framework/app internals, the better. In reality I would probably just put a data-test attribute on the child component if I truly didn't want to care about the DOM at all, so that my tests don't have to be updated when I change the organization of components.