chore: fix eslint errors (#43693)

* fix: fix master CI fail

* fix: fix master CI fail

* test: fix test case
This commit is contained in:
lijianan 2023-07-21 12:33:05 +08:00 committed by GitHub
parent d6fe1355a9
commit c8b74859ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 11 deletions

View File

@ -1,6 +1,4 @@
import React, { useState } from 'react';
import ReactDOM from 'react-dom';
import { act } from 'react-dom/test-utils';
import Avatar from '..';
import mountTest from '../../../tests/shared/mountTest';
import rtlTest from '../../../tests/shared/rtlTest';
@ -140,14 +138,9 @@ describe('Avatar Render', () => {
Object.entries(sizes).forEach(([key, value]) => {
it(`adjusts component size to ${value} when window size is ${key}`, () => {
const wrapper = global.document.createElement('div');
(useBreakpoint as any).mockReturnValue({ [key]: true });
act(() => {
ReactDOM.render(<Avatar size={sizes} />, wrapper);
});
expect(wrapper).toMatchSnapshot();
const { container } = render(<Avatar size={sizes} />);
expect(container).toMatchSnapshot();
});
});

View File

@ -401,7 +401,7 @@ describe('Calendar', () => {
for (let index = start; index < end; index += 1) {
monthOptions.push(
<Select.Option className="month-item" key={`${index}`} value={index}>
<Select.Option className="month-item" key={index} value={index}>
{months[index]}
</Select.Option>,
);

View File

@ -67,7 +67,7 @@ const Image: CompositionImage<ImageProps> = (props) => {
return wrapSSR(
<RcImage
prefixCls={`${prefixCls}`}
prefixCls={prefixCls}
preview={mergedPreview}
rootClassName={mergedRootClassName}
className={mergedClassName}