From e8f5b5a4c6da423c196147ee0aff4b6ff7acae4e Mon Sep 17 00:00:00 2001
From: tangjinzhou <415800467@qq.com>
Date: Fri, 14 Feb 2020 20:46:04 +0800
Subject: [PATCH] test: add empty test
---
components/empty/__tests__/index.test.js | 25 ++++++++++++++++++++++++
1 file changed, 25 insertions(+)
create mode 100644 components/empty/__tests__/index.test.js
diff --git a/components/empty/__tests__/index.test.js b/components/empty/__tests__/index.test.js
new file mode 100644
index 000000000..9d88239d7
--- /dev/null
+++ b/components/empty/__tests__/index.test.js
@@ -0,0 +1,25 @@
+import { mount } from '@vue/test-utils';
+import Empty from '..';
+import mountTest from '../../../tests/shared/mountTest';
+
+describe('Empty', () => {
+ mountTest(Empty);
+
+ it('image size should change', () => {
+ const wrapper = mount({
+ render() {
+ return ;
+ },
+ });
+ expect(wrapper.find('.ant-empty-image').element.style.height).toBe('20px');
+ });
+
+ it('description can be false', () => {
+ const wrapper = mount({
+ render() {
+ return ;
+ },
+ });
+ expect(wrapper.findAll('.ant-empty-description').length).toBe(0);
+ });
+});