test: add empty test

pull/1790/head
tangjinzhou 2020-02-14 20:46:04 +08:00
parent 2e61889cf7
commit e8f5b5a4c6
1 changed files with 25 additions and 0 deletions

View File

@ -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 <Empty imageStyle={{ height: '20px' }} />;
},
});
expect(wrapper.find('.ant-empty-image').element.style.height).toBe('20px');
});
it('description can be false', () => {
const wrapper = mount({
render() {
return <Empty description={false} />;
},
});
expect(wrapper.findAll('.ant-empty-description').length).toBe(0);
});
});