From 5571fcec6441eb5d7dd21de7dd65137ba5468ffa Mon Sep 17 00:00:00 2001 From: zhangshun Date: Thu, 5 Jan 2023 16:37:08 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=20=E4=BF=AE=E5=A4=8D=E5=9C=A8?= =?UTF-8?q?=E9=9D=9E=E5=8F=97=E6=8E=A7=E6=83=85=E5=86=B5=E4=B8=8B=E5=BC=80?= =?UTF-8?q?=E5=90=AFallowClear,=E7=82=B9=E5=87=BB=E6=B8=85=E9=99=A4Icon?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E6=97=A0=E6=95=88=20(#2133)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/list-picker/listPicker.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/list-picker/listPicker.tsx b/src/list-picker/listPicker.tsx index 1a6ea44490..be84750008 100644 --- a/src/list-picker/listPicker.tsx +++ b/src/list-picker/listPicker.tsx @@ -137,6 +137,7 @@ export const ListPicker: React.FC = (props) => { const clearInput = () => { setValue(undefined); + setPrevValue(undefined); onClear?.(); onChange?.(); }; From c15b20f99a1de1d7549bcc5c7571fa7e59d218da Mon Sep 17 00:00:00 2001 From: YanHui Date: Thu, 5 Jan 2023 18:23:40 +0800 Subject: [PATCH 2/2] fix unit-test --- src/static-date-picker/__tests__/index.test.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/static-date-picker/__tests__/index.test.tsx b/src/static-date-picker/__tests__/index.test.tsx index 99f1b06de7..460f1cee8c 100644 --- a/src/static-date-picker/__tests__/index.test.tsx +++ b/src/static-date-picker/__tests__/index.test.tsx @@ -5,12 +5,12 @@ import StaticDatePicker from '../StaticDatePicker'; describe('Testing StaticDatePicker ', () => { it('without params', () => { render(); - expect(screen.getByText('26')).toBeTruthy(); + expect(screen.getByText('24')).toBeTruthy(); }); it('disabledDate is function', () => { render( current.getTime() > new Date().getTime()} />); - expect(screen.getByText('26')).toBeTruthy(); + expect(screen.getByText('24')).toBeTruthy(); }); it('onPanelChange has onPanelChange', () => { @@ -24,15 +24,15 @@ describe('Testing StaticDatePicker ', () => { fireEvent.click(container.querySelector('button[class="gio-picker-header-super-prev-btn"]')); - expect(screen.getByText('26')).toBeTruthy(); + expect(screen.getByText('24')).toBeTruthy(); fireEvent.click(container.querySelector('button[class="gio-picker-header-prev-btn"]')); - expect(screen.getByText('26')).toBeTruthy(); + expect(screen.getByText('24')).toBeTruthy(); - fireEvent.click(screen.getByText('26')); + fireEvent.click(screen.getByText('24')); - expect(screen.getByText('26')).toBeTruthy(); + expect(screen.getByText('24')).toBeTruthy(); }); it('onPanelChange not onPanelChange', () => { @@ -42,6 +42,6 @@ describe('Testing StaticDatePicker ', () => { fireEvent.click(container.querySelector('button[class="gio-picker-header-super-prev-btn"]')); - expect(screen.getByText('26')).toBeTruthy(); + expect(screen.getByText('24')).toBeTruthy(); }); });