Closed
Description
Version
1.0.0-beta.26
Steps to reproduce
I write some test for my child component. But below mount function can not render child component, if above function use shallowMount. But when I change first test function to mount, below function work properly.
What is expected?
Function mount work properly
What is actually happening?
Function mount doesn't work properly
Here is my code:
test('test UI with create User', () => {
const wrapper = shallowMount(AddUser, {
localVue,
store,
mocks: {
$router,
},
});
console.log(wrapper.html());
expect(wrapper.find('alertpanel-stub').exists()).toBe(true);
expect(wrapper.find('userform-stub').exists()).toBe(true);
expect(wrapper.find('button[id="addBtn"]').exists()).toBe(true);
});
test('add user with invalid input', async () => {
const wrapper = mount(AddUser, {
localVue,
store,
mocks: {
$router,
},
});
console.log(wrapper.html());
wrapper.find('#addBtn').trigger('click');
await flushPromises();
expect(wrapper.vm.errors.count()).toBeGreaterThan(0);
});