vuejs / vue-test-utils

Component Test Utils for Vue 2
https://vue-test-utils.vuejs.org
MIT License
3.57k stars 668 forks source link

Does "mocha chai" test plugin in vue-cli 3 support elementUI? #1221

Open voldemortX opened 5 years ago

voldemortX commented 5 years ago

What problem does this feature solve?

I'm using the elementUI plugin from vue-cli 3, however it seems that unit-test can't manipulate the "el-" tags(like setValue() can't be used). Actually I'm not quite sure if this is in fact supported and I have been using it wrong. -_-

What does the proposed API look like?

To test tags in other UI libs like using ordinary tags?

eddyerburgh commented 5 years ago

We could definitely improve the experience for testing third party library components. The problem is they are often implemented as functional components, and functional components have sdome gotchas in Vue Test Utils.

voldemortX commented 5 years ago

Thanks! Inspired by your comment, I just found that when using @click.native in 'el-button' and finding a 'el-button' as 'el-button-stub' can trigger the 'click' event correctly.

We could definitely improve the experience for testing third party library components. The problem is they are often implemented as functional components, and functional components have sdome gotchas in Vue Test Utils.