Closed
Description
I wanted to use hasClass
method this way:
expect(wrapper.hasClass('some-class')).to.be.true
but I've got error:
undefined is not an object (evaluating 'this.element.classList.contains')
while this one:
expect(wrapper.vm.$el.classList.contains('some-class')).to.be.true
works.
I've tried to debug it a bit, and added these lines into hasClass
method:
console.log(this.element);
console.log(this.vm.$el);
and I've got output:
LOG: <!---->
LOG: <div class="some-class">...</div>
What do you think? It's ok that element
and vm.$el
are different?