-
Notifications
You must be signed in to change notification settings - Fork 669
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Transition javascript hooks firing? #1603
Comments
Hi! You are right - Vue Test Utils stubs out This change was made in #1411. You should be able to get them to trigger like this, I think: #1411 (comment) If you can share your test, I might be able to suggest some strategies to test it, if that doesn't work. |
Thanks for the response! I checked, and that solution does appear to fix most issues, but still doesn't fire any hooks. If this is simply isn't possible right now, totally fine. But if it is, I'd love to hear how :) Here's the test suite:
|
Oh!!! I just realized I was mucking around with that trying to get it to work, and I changed the emitter name. So, thanks so much :) |
well, actually, it appears the from above, here's the updated test suite that is failing the
And the beginning of the component that fires these transitions:
|
I have never tested those transition hooks. I don't see why they wouldn't trigger, though. Maybe you can wrap it in a |
Closing again as the coverage issues are covered at #1977 |
Subject of the issue
I have a component which is entirely wrapped in a transition. This component begins with
isShowing
asfalse
, waits a tick, then sets it totrue
, thus kicking off the transition.In all visual testing and building of the component, this works great. They fire, all is well. In my test, however, they don't seem to fire.
Steps to reproduce
@enter="$emit('show')
.$nextTick
or something, even a timeout, so that the event would hav efiredexpect(wrapper.emitted('show')).toBeTruthy()
This will not pass (for me)
Expected behaviour
Test should pass, becuase the transition
@enter
hook should have fired, which should have emitted theshow
eventActual behaviour
wrapper.emitted()
is totally blank. Even after a manual, 5second timeout, just to be sure. Nothing was emitted. I even tested against this by tossing the emitter right inmounted()
, and then it worked and was seen. So I know it isn't the emitting logic.Possible Solution
Not sure. Does vue test utils "silence" these transition hooks? Or perhaps not account for them?
The text was updated successfully, but these errors were encountered: