mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-05 05:28:20 +08:00
502dac12aa
* docs: fix code * feat: lint * feat: prettier * feat: test * feat: review * feat: format html * feat: format html
30 lines
872 B
TypeScript
30 lines
872 B
TypeScript
import * as React from 'react';
|
|
|
|
import Divider from '..';
|
|
import mountTest from '../../../tests/shared/mountTest';
|
|
import { render } from '../../../tests/utils';
|
|
|
|
describe('Divider', () => {
|
|
mountTest(Divider);
|
|
|
|
it('not show children when vertical', () => {
|
|
const errSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
|
|
|
|
const { container } = render(<Divider type="vertical">Bamboo</Divider>);
|
|
expect(container.querySelector<HTMLSpanElement>('.ant-divider-inner-text')).toBeFalsy();
|
|
|
|
errSpy.mockRestore();
|
|
});
|
|
|
|
it('support string orientationMargin', () => {
|
|
const { container } = render(
|
|
<Divider orientation="right" orientationMargin="10">
|
|
test test test
|
|
</Divider>,
|
|
);
|
|
expect(container?.querySelector<HTMLSpanElement>('.ant-divider-inner-text')).toHaveStyle({
|
|
marginRight: 10,
|
|
});
|
|
});
|
|
});
|