From a3077e449ed13eb5831b8f27caae630791d622f9 Mon Sep 17 00:00:00 2001 From: Christine Tang <42272524+Christine-Only@users.noreply.github.com> Date: Fri, 22 Mar 2024 21:29:19 +0800 Subject: [PATCH] test: rm unnecessary async (#48033) * chore: rm unnecessary React.useMemo * Revert "chore: reset commit" This reverts commit 2fa5df518582211884fbec5911641d0998d5a6fa. * test: rm unnecessary async --- components/_util/__tests__/getScroll.test.ts | 10 +++++----- components/drawer/__tests__/Drawer.test.tsx | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/components/_util/__tests__/getScroll.test.ts b/components/_util/__tests__/getScroll.test.ts index 8cb737ff1a..f7b7e11d9e 100644 --- a/components/_util/__tests__/getScroll.test.ts +++ b/components/_util/__tests__/getScroll.test.ts @@ -1,12 +1,12 @@ import getScroll from '../getScroll'; describe('getScroll', () => { - it('getScroll target null', async () => { + it('getScroll target null', () => { expect(getScroll(null, true)).toBe(0); expect(getScroll(null, false)).toBe(0); }); - it('getScroll window', async () => { + it('getScroll window', () => { const scrollToSpy = jest.spyOn(window, 'scrollTo').mockImplementation((x, y) => { window.pageXOffset = x; window.pageYOffset = y; @@ -17,7 +17,7 @@ describe('getScroll', () => { scrollToSpy.mockRestore(); }); - it('getScroll document', async () => { + it('getScroll document', () => { const scrollToSpy = jest.spyOn(window, 'scrollTo').mockImplementation((x, y) => { document.documentElement.scrollLeft = x; document.documentElement.scrollTop = y; @@ -28,7 +28,7 @@ describe('getScroll', () => { scrollToSpy.mockRestore(); }); - it('getScroll div', async () => { + it('getScroll div', () => { const div = document.createElement('div'); const scrollToSpy = jest.spyOn(window, 'scrollTo').mockImplementation((x, y) => { div.scrollLeft = x; @@ -40,7 +40,7 @@ describe('getScroll', () => { scrollToSpy.mockRestore(); }); - it('getScroll documentElement', async () => { + it('getScroll documentElement', () => { const div: any = {}; const scrollToSpy = jest.spyOn(window, 'scrollTo').mockImplementation((x, y) => { div.scrollLeft = null; diff --git a/components/drawer/__tests__/Drawer.test.tsx b/components/drawer/__tests__/Drawer.test.tsx index 5f0aa5df30..b81c530ba4 100644 --- a/components/drawer/__tests__/Drawer.test.tsx +++ b/components/drawer/__tests__/Drawer.test.tsx @@ -244,7 +244,7 @@ describe('Drawer', () => { errorSpy.mockRestore(); }); - it('should hide close button when closeIcon is null or false', async () => { + it('should hide close button when closeIcon is null or false', () => { const { baseElement, rerender } = render( Here is content of Drawer @@ -311,7 +311,7 @@ describe('Drawer', () => { expect(baseElement.querySelector('.anticon-close')).not.toBeNull(); }); - it('match between styles and deprecated style prop', async () => { + it('match between styles and deprecated style prop', () => { const initialFontSize = 10; let fontSize1 = initialFontSize; let fontSize2 = initialFontSize;