I am implementing unit test cases for my vue application with jest
I have a situation where i need to test a input field in a child component.
<parent-component>
<child-component>
<input type="text" v-model="inputValue" />
</child-component>
</parent-component>
My test goes like below
it('check empty validation', () => {
const wrapper = mount(parentComponent, {
propsData: {
test:test
}
});
wrapper.find(childComponent).vm.inputValue = "";
expect(wrapper.vm.errorMessage).toBe("cannot be empty");
});
But setting model doesnt seems to be working.
How to set value to text box and test the same is my question
Thanks