Skip to content

Commit f542431

Browse files
authored
test(comment): 添加单元测试 (DevCloudFE#404)
1 parent bca7b63 commit f542431

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed
Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
import { mount } from '@vue/test-utils';
2+
import { Comment } from '..';
3+
14
describe('comment test', () => {
2-
it.todo('comment init render');
5+
it('comment init render', async () => {
6+
const wrapper = mount(Comment, {
7+
slots: {
8+
actions: 'Comment Actions',
9+
author: 'Comment Author',
10+
avatar: 'Comment Avatar',
11+
content: 'Comment Content',
12+
datetime: 'Comment Datetime',
13+
},
14+
});
15+
expect(wrapper.find('.devui-comment').exists()).toBe(true);
16+
expect(wrapper.find('.devui-comment-actions').text()).toBe('Comment Actions');
17+
expect(wrapper.find('.devui-comment-author').text()).toBe('Comment Author');
18+
expect(wrapper.find('.devui-comment-avatar').text()).toBe('Comment Avatar');
19+
expect(wrapper.find('.devui-comment-content').text()).toBe('Comment Content');
20+
expect(wrapper.find('.devui-comment-datetime').text()).toBe('Comment Datetime');
21+
});
322
});

0 commit comments

Comments
 (0)