I have a component that is using an element-ui component.
Tree.vue
<div>
<el-tree :data="treeData" :props="config"></el-tree>
</div>
I want to test the interactivity with the component (for example, to be able to click on one of the el-tree
html elements), but when I'm using vue-test-utils
mount
to mount the Tree
component, it doesn't render it's children component, like it shallow
ing the component instead.
Tree.test.js
import Vue from 'vue';
import { mount } from 'vue-test-utils';
import Tree from './Tree.vue';
const wrapper = mount(Tree);
it('renders element ui tree component', () => {
console.log(wrapper.html());
});
Outputs:
<div><el-tree data="[object Object],[object Object]" props="[object Object]"></el-tree></div>
Any idea how can I fully render the Tree
component, including it's children?