test: rm unnecessary async (#48033)

* chore: rm unnecessary React.useMemo

* Revert "chore: reset commit"

This reverts commit 2fa5df518582211884fbec5911641d0998d5a6fa.

* test: rm unnecessary async
This commit is contained in:
Christine Tang 2024-03-22 21:29:19 +08:00 committed by GitHub
parent e17cd4ae27
commit a3077e449e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 7 deletions

View File

@ -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;

View File

@ -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(
<Drawer open closeIcon={null}>
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;