diff --git a/components/progress/Circle.tsx b/components/progress/Circle.tsx index 06cb3acb16..67cf06731f 100644 --- a/components/progress/Circle.tsx +++ b/components/progress/Circle.tsx @@ -28,12 +28,10 @@ const Circle: React.FC = (props) => { type, children, success, - size, + size = originWidth, } = props; - const mergedSize = size ?? [originWidth, originWidth]; - - const [width, height] = getSize(mergedSize, 'circle'); + const [width, height] = getSize(size, 'circle'); let { strokeWidth } = props; if (strokeWidth === undefined) { diff --git a/components/progress/__tests__/index.test.tsx b/components/progress/__tests__/index.test.tsx index ab2f75a30a..01449854f7 100644 --- a/components/progress/__tests__/index.test.tsx +++ b/components/progress/__tests__/index.test.tsx @@ -264,6 +264,13 @@ describe('Progress', () => { ); }); + it('should not warning if not pass the `size` prop in type Circle', () => { + const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {}); + errorSpy.mockClear(); + render(); + expect(errorSpy).not.toHaveBeenCalled(); + }); + it('should warnning if pass number[] into `size` in type dashboard', () => { const errorSpy = jest.spyOn(console, 'error').mockImplementation(() => {}); render();