Skip to content

Commit e8f5b5a

Browse files
committed
test: add empty test
1 parent 2e61889 commit e8f5b5a

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import { mount } from '@vue/test-utils';
2+
import Empty from '..';
3+
import mountTest from '../../../tests/shared/mountTest';
4+
5+
describe('Empty', () => {
6+
mountTest(Empty);
7+
8+
it('image size should change', () => {
9+
const wrapper = mount({
10+
render() {
11+
return <Empty imageStyle={{ height: '20px' }} />;
12+
},
13+
});
14+
expect(wrapper.find('.ant-empty-image').element.style.height).toBe('20px');
15+
});
16+
17+
it('description can be false', () => {
18+
const wrapper = mount({
19+
render() {
20+
return <Empty description={false} />;
21+
},
22+
});
23+
expect(wrapper.findAll('.ant-empty-description').length).toBe(0);
24+
});
25+
});

0 commit comments

Comments
 (0)