vue test utils - setTimeout()

await wrapper.vm.$nextTick()
/*
timeout 2750, will trigger save after update and not cancel by user
*/
expect(wrapper.vm.action).toBe('update')
await wrapper.vm.$nextTick()
setTimeout(() => {
expect(wrapper.vm.action).toBe('save')
}, 2750)

Comments

Popular posts from this blog

About GraphQL - Downside