Wrapper(vNode, update)
Creates a Wrapper object with helper methods to test a vNode element.
Arguments
vNode
(VNode
): The virtual node object
update
(Function
): Function to update the VNode or Component after changes.
Methods
- children
- find
- getAttributeValue
- hasAttribute
- hasClass
- hasStyle
- html
- is
- refresh
- removeAttribute
- setAttribute
- setText
- simulate
- simulateMouse
- text
Example
import Vue from 'vue';
import Wrapper from '@jasoeight/vue-testing/lib/Wrapper';
import Example from './path/to/Example.vue';
const Ctor = Vue.extend(Example);
const vm = new Ctor();
vm.$mount();
return new Wrapper(vm._vnode, vm._watcher.run.bind(vm._watcher));