0👍
When your component have async methods, like fetch user fields on mounted, you have two options when testing:
Option 1: Test with an async function and await for the nextTick
Option 2: Use the package flush-promises
Both options are detailed in the vuejs test utils documentation with examples.
Also, you can mock axios response with some data for populate your user fields without a real fetch to your backend.
- [Vuejs]-I can't use datalist's change event in vue.js, change event is not working
- [Vuejs]-<li> be moved to another <ul> by vue
Source:stackexchange.com