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(); 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(() => {}); const errSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
render( render(
<Breadcrumb> <Breadcrumb>
@ -194,8 +194,8 @@ describe('Breadcrumb', () => {
); );
errSpy.mockRestore(); 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(() => {}); const errSpy = jest.spyOn(console, 'error').mockImplementation(() => {});
render(<Breadcrumb routes={[{ path: '/', breadcrumbName: 'Test' }]} />); render(<Breadcrumb routes={[{ path: '/', breadcrumbName: 'Test' }]} />);
expect(errSpy).not.toHaveBeenCalled(); expect(errSpy).not.toHaveBeenCalled();

View File

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