mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-05 05:28:20 +08:00
30ac6bd4e4
* test: React StrictMode * test: fix Spin test * chore: wrapper enzyme * test: fix setState * test: more test cover * test: more test cover * test: more test cover * test: more test cover * test: more test cover * test: more test case * test: more test case * test: more test case * test: more test case * test: more test case * test: more test case * test: more test case * test: more test case * test: more test case * test: more test case * test: more test case * test: more test case * test: disable part of it * test: fix test & add placeholder * test: Use orign enzyme mount Co-authored-by: zombiej <smith3816@gmail.com>
31 lines
895 B
JavaScript
31 lines
895 B
JavaScript
import React from 'react';
|
|
import { mount } from 'enzyme';
|
|
import Empty from '..';
|
|
import ConfigProvider from '../../config-provider';
|
|
import mountTest from '../../../tests/shared/mountTest';
|
|
import rtlTest from '../../../tests/shared/rtlTest';
|
|
|
|
describe('Empty', () => {
|
|
mountTest(Empty);
|
|
rtlTest(Empty);
|
|
|
|
it('image size should change', () => {
|
|
const wrapper = mount(<Empty imageStyle={{ height: 20 }} />);
|
|
expect(wrapper.find('.ant-empty-image').props().style.height).toBe(20);
|
|
});
|
|
|
|
it('description can be false', () => {
|
|
const wrapper = mount(<Empty description={false} />);
|
|
expect(wrapper.find('.ant-empty-description').length).toBe(0);
|
|
});
|
|
|
|
it('should render in RTL direction', () => {
|
|
const wrapper = mount(
|
|
<ConfigProvider direction="rtl">
|
|
<Empty />
|
|
</ConfigProvider>,
|
|
);
|
|
expect(wrapper.render()).toMatchSnapshot();
|
|
});
|
|
});
|