mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-24 02:59:58 +08:00
test: add test case (#42800)
This commit is contained in:
parent
26ab02f38a
commit
71c155f043
@ -1,7 +1,7 @@
|
||||
import * as React from 'react';
|
||||
import { render } from '../../../tests/utils';
|
||||
import Divider from '..';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import { render } from '../../../tests/utils';
|
||||
|
||||
describe('Divider', () => {
|
||||
mountTest(Divider);
|
||||
@ -10,8 +10,19 @@ describe('Divider', () => {
|
||||
const errSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
|
||||
|
||||
const { container } = render(<Divider type="vertical">Bamboo</Divider>);
|
||||
expect(container.querySelector('.ant-divider-inner-text')).toBeFalsy();
|
||||
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,
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user