Vue test-utils
Does it support finding a component in a list using its key? If not, is there any other way to find components generated as a list in vue?
P粉1564156962024-03-28 00:57:35
You cannot query a component using a key in the findComponent()
method.
But you can get all the components in the list and filter them like a regular array. Just provide the correct criteria to find the item you want (using its props, properties, or other content)
const items = wrapper.findAllComponents(MyListItem) const foundItem = items.wrappers.find(listItem => list.props('id') === 'theIdILookFor')