What is WrapperLike
type?
#1176
-
With RC.18, a To get around this, I can case the wrapper as such: const button = wrapper.findComponent('[data-testid="cancel-button"]');
await (button as VueWrapper).trigger('click'); But that seems like a pretty weird thing to have to do. Is this intended behaviour? I believe in RC.17, this same |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
Hi @kensodemann As you can see here https://github.com/vuejs/vue-test-utils-next/blob/b118e9aa956a81997dc1276583c0f48c5a767387/src/interfaces/wrapperLike.ts#L33-L46 it depends what you pass as a selector. As you chose to use a string to find your component, it returns a cc @xanf as he is the author of this recent refactoring, and he might have more insight. |
Beta Was this translation helpful? Give feedback.
-
@kensodemann |
Beta Was this translation helpful? Give feedback.
@kensodemann
WrapperLike
means we can't guarantee if it will be aVueWrapper
orDOMWrapper
(functional components returnDOMWrapper
). But great catch -trigger
should be available onWrapperLike
interface too