Random things of a random world

Sami's Page

  • Join Us on Facebook!
  • Follow Us on Twitter!
  • LinkedIn
  • Subcribe to Our RSS Feed

Things Learned: Testing Vuetify Clicks Needs Special Care With Trigger/Emit

Trying to test Vuetify things and of course documentation on testing Vue in general is all over the place. Lots of old stuff mixed with new and very confusing.

I tried to do a simple thing: click on a v-btn. That's it, very simple. But doing the regular button.trigger('click') does nothing. Wondered a lot. Tried everything. All kinds of nextTick() and whatnot that was suggested. Nothing. Then came across to others having the same issue. Of course we need to emit the click, not trigger it since these are components.

There's also link to documentation, which doesn't exactly tell anything about clicking but does talk about emitting in certain cases. I for one wouldn't realize to use emit from that.

But now it works. So, on to next steps...

Add comment