You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
871 B
28 lines
871 B
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,
|
|
});
|
|
});
|
|
});
|
|
|