chore: fix typo (#38568)

This commit is contained in:
lijianan 2022-11-15 15:51:34 +08:00 committed by GitHub
parent d8a4c1ad04
commit 5ef12dfaa5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 6 deletions

View File

@ -182,7 +182,7 @@ describe('Breadcrumb', () => {
expect(container.firstChild).toMatchSnapshot();
});
it('should console Error then `overlay` in props', () => {
it('should console Error when `overlay` in props', () => {
const errSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
render(
<Breadcrumb>
@ -194,8 +194,8 @@ describe('Breadcrumb', () => {
);
errSpy.mockRestore();
});
it('should not console Error then `overlay` not in props', () => {
it('should not console Error when `overlay` not in props', () => {
const errSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
render(<Breadcrumb routes={[{ path: '/', breadcrumbName: 'Test' }]} />);
expect(errSpy).not.toHaveBeenCalled();

View File

@ -14,7 +14,7 @@ jest.mock('../dropdown', () => {
const MockedDropdown: React.FC<DropdownProps> & {
Button: typeof ActualDropdownComponent.Button;
} = props => {
} = (props) => {
dropdownProps = props;
const { children, ...restProps } = props;
return h.createElement(ActualDropdownComponent, { ...restProps }, children);
@ -131,7 +131,7 @@ describe('DropdownButton', () => {
'ant-btn',
);
});
it('should console Error then `overlay` in props', () => {
it('should console Error when `overlay` in props', () => {
const errSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
render(<DropdownButton overlay={<div>test</div>} />);
expect(errSpy).toHaveBeenCalledWith(
@ -139,7 +139,7 @@ describe('DropdownButton', () => {
);
errSpy.mockRestore();
});
it('should not console Error then `overlay` not in props', () => {
it('should not console Error when `overlay` not in props', () => {
const errSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
render(<DropdownButton />);
expect(errSpy).not.toHaveBeenCalled();