feat: Empty component

This commit is contained in:
chenjiahan
2020-07-06 15:28:43 +08:00
parent 0e4b5a0f2f
commit aab12a4906
12 changed files with 679 additions and 15 deletions
+42
View File
@@ -0,0 +1,42 @@
import Empty from '..';
import { mount } from '../../../test';
test('image slot', () => {
const wrapper = mount(Empty, {
scopedSlots: {
image: () => 'Custom Image',
},
});
expect(wrapper).toMatchSnapshot();
});
test('description slot', () => {
const wrapper = mount(Empty, {
scopedSlots: {
description: () => 'Custom description',
},
});
expect(wrapper).toMatchSnapshot();
});
test('bottom slot', () => {
const wrapper = mount(Empty, {
scopedSlots: {
default: () => 'Custom bottom',
},
});
expect(wrapper).toMatchSnapshot();
});
test('render svg when image is network', () => {
const wrapper = mount(Empty, {
propsData: {
image: 'network',
},
});
expect(wrapper).toMatchSnapshot();
});