-
Notifications
You must be signed in to change notification settings - Fork 668
Clarify DOM updates should be awaited on API documentation #1626
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
Comments
I will gladly make the necessary changes if we agree on a format. Let me know 👋 |
Yep... the I don't know of a specific format, I think we should go through and update everything to encourage using Maybe we can just recommend any method with What format/update are you thinking @99linesofcode ? Can you give an example how you think we can make it more clear? @afontcu probably has some input here! |
Ok, so my current project is still on version it('renders an error message when the error property is passed', async () => {
expect(wrapper.find('span').text()).toEqual(wrapper.vm.error);
await wrapper.setProps({ error: null });
expect(wrapper.find('span').exists()).toBe(false);
});
Yeah, #1517 introduced this change. I see the API docs for
I think simply updating the examples as you proposed should suffice. I would also include a Let me make the necessary changes and tell me whether I missed something 😄 |
What problem does this feature solve?
New developers such as me might not be aware that certain API methods are asynchronous and expect DOM updates to be handled automatically.
Specifically, the
setProps()
usage states:Sets Wrapper vm props and forces update.
which threw me off.Now, I realize this is blatantly obvious to those who know their way around Vue.js but I found myself spending quite a bit of time figuring this out.
What does the proposed API look like?
The text was updated successfully, but these errors were encountered: