blob: c9c33cf3af14e8c67e04d2a461e9a9a56db2d017 (
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
37
|
import { shallowMount } from '@vue/test-utils';
import { GlButton } from '@gitlab/ui';
import ReplyPlaceholder from '~/notes/components/discussion_reply_placeholder.vue';
const buttonText = 'Test Button Text';
describe('ReplyPlaceholder', () => {
let wrapper;
const findButton = () => wrapper.find(GlButton);
beforeEach(() => {
wrapper = shallowMount(ReplyPlaceholder, {
propsData: {
buttonText,
},
});
});
afterEach(() => {
wrapper.destroy();
});
it('should emit a onClick event on button click', () => {
findButton().vm.$emit('click');
return wrapper.vm.$nextTick().then(() => {
expect(wrapper.emitted()).toEqual({
onClick: [[]],
});
});
});
it('should render reply button', () => {
expect(findButton().text()).toEqual(buttonText);
});
});
|