import { createLocalVue, shallowMount } from '@vue/test-utils'; import CommentInput from '@/components/rooms/CommentInput'; const localVue = createLocalVue(); localVue.directive('auto-grow', {}); describe('CommentInput.vue', () => { it('should clear input after submit', async () => { const inputText = 'some value'; const wrapper = shallowMount(CommentInput, { localVue, }); const textInput = wrapper.find('[data-cy="comment-textarea"]'); await textInput.setValue(inputText); wrapper.vm.submit(); expect(wrapper.emitted()['submit'][0]).toEqual([inputText]); }); });