-
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
Re-render does not occur synchronously when reactive data is changed in mounted life-cycle hook #1035
Comments
Aaron-Pool
changed the title
Rer-ender does not occur synchronously when reactive data is changed in mounted life-cycle hook
Re-render does not occur synchronously when reactive data is changed in mounted life-cycle hook
Nov 27, 2018
recognizing this doesn't directly address the synchronicity issue, I found a slightly more elegant temporary workaround is to make the test const comp = factory(mockSlot)
await comp.vm.$nextTick()
expect(........) |
@pgoshulak Thanks for the heads up on that 👍 I may implement that as a stopgap as well, to make things cleaner. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Version
1.0.0-beta.25
Reproduction link
https://github.com/Aaron-Pool/vue-test-utils-jest-example
Steps to reproduce
Run yarn
yarn jest
What is expected?
Test should pass, because reactive data changed in the mount component, so the scoped slot function should have been called again on re-render.
What is actually happening?
No re-render occurs, even though the data updates as expected.
I assume this has something to do with async vs. sync paradigm that is happening in the test-utils.
It works correctly if I run the test like so:
The text was updated successfully, but these errors were encountered: