blob: 2a4cd0df0c7ef77cc65b0d924b0592d40bc8f02a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
import { shallowMount } from '@vue/test-utils';
import ReplyPlaceholder from '~/notes/components/discussion_reply_placeholder.vue';
const placeholderText = 'Test Button Text';
describe('ReplyPlaceholder', () => {
let wrapper;
const findTextarea = () => wrapper.find({ ref: 'textarea' });
beforeEach(() => {
wrapper = shallowMount(ReplyPlaceholder, {
propsData: {
placeholderText,
},
});
});
afterEach(() => {
wrapper.destroy();
});
it('emits focus event on button click', () => {
findTextarea().trigger('focus');
return wrapper.vm.$nextTick().then(() => {
expect(wrapper.emitted()).toEqual({
focus: [[]],
});
});
});
it('should render reply button', () => {
expect(findTextarea().attributes('placeholder')).toEqual(placeholderText);
});
});
|