Issues on slots / urls props binding / how to call a function / how to test @input and @blur as wrapper.vm.xxxxxx #825
patrickyue
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, there
I have several qq here, need some help
#1 Slots
we could send a props. slots before as
{ default: '<div></div>'},
but this now will create a Vue warning to ask us to get a function call for better performance,as
{ default: () =>'<div></div>' }.
then, for the previous DOM search, the element inside that HTML code will fail now, as it will not be there anymore.
#2 urls binding issue
we have props as { altText: 'some test', url: 'some urls' }. this now will break the unit testing,
this will happen for both image as
:src=url
, and a as:href = url
, not sure what do I miss...but I if I change the key name from url to imageUrl, it works, what do I miss here?
#3 How I call a function directly now ?
If you have a function named unitTesting inside your component,
We can do
wrapper.vm.unitTesting
to call that function previously, now after the new update,not sure how to call them as wrapper.vm.unitTesting will have type errors. and tried
wrapper.setupState.unitTesting
, it is not working#4 How to testing a input element with @input and @blur events?
I tried almost everything, the event function does not get triggerred
tried the documentation one inside vue-utils. that's why I need #3 to be there
any help is welcome,
thanks in advance
Beta Was this translation helpful? Give feedback.
All reactions