mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-26 20:20:00 +08:00
1fed15ceeb
* test: replace Empty part test with test lib * test: update snapshot case
31 lines
954 B
JavaScript
31 lines
954 B
JavaScript
import React from 'react';
|
|
import Empty from '..';
|
|
import ConfigProvider from '../../config-provider';
|
|
import { render } from '../../../tests/utils';
|
|
import mountTest from '../../../tests/shared/mountTest';
|
|
import rtlTest from '../../../tests/shared/rtlTest';
|
|
|
|
describe('Empty', () => {
|
|
mountTest(Empty);
|
|
rtlTest(Empty);
|
|
|
|
it('image size should change', () => {
|
|
const { container } = render(<Empty imageStyle={{ height: 20 }} />);
|
|
expect(container.querySelector('.ant-empty-image').style.height).toBe('20px');
|
|
});
|
|
|
|
it('description can be false', () => {
|
|
const { container } = render(<Empty description={false} />);
|
|
expect(container.querySelector('.ant-empty-description')).toBeFalsy();
|
|
});
|
|
|
|
it('should render in RTL direction', () => {
|
|
const { asFragment } = render(
|
|
<ConfigProvider direction="rtl">
|
|
<Empty />
|
|
</ConfigProvider>,
|
|
);
|
|
expect(asFragment().firstChild).toMatchSnapshot();
|
|
});
|
|
});
|