24 lines
570 B
JavaScript
24 lines
570 B
JavaScript
import {createLocalVue, shallowMount} from '@vue/test-utils'
|
|
import CommentInput from '@/components/rooms/CommentInput';
|
|
|
|
const localVue = createLocalVue()
|
|
|
|
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]);
|
|
});
|
|
|
|
})
|