mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-27 20:49:53 +08:00
Remove unnecessary act() calls (#49326)
* refactor(tests): remove unnecessary act() calls * chore: do npm test -- -u
This commit is contained in:
parent
30babc686c
commit
6ea55a19dc
@ -46989,7 +46989,7 @@ Array [
|
||||
</div>
|
||||
</div>,
|
||||
<div
|
||||
class="ant-picker-dropdown ant-slide-up-appear ant-slide-up-appear-prepare ant-slide-up ant-picker-dropdown-placement-bottomLeft"
|
||||
class="ant-picker-dropdown ant-slide-up-appear ant-slide-up-appear-prepare ant-slide-up ant-picker-dropdown-placement-topLeft"
|
||||
style="--arrow-x: 0px; --arrow-y: 0px; left: -1000vw; top: -1000vh; box-sizing: border-box;"
|
||||
>
|
||||
<div
|
||||
@ -47643,7 +47643,7 @@ Array [
|
||||
</span>
|
||||
</div>,
|
||||
<div
|
||||
class="ant-picker-dropdown ant-slide-up-appear ant-slide-up-appear-prepare ant-slide-up ant-picker-dropdown-range ant-picker-dropdown-placement-bottomLeft"
|
||||
class="ant-picker-dropdown ant-slide-up-appear ant-slide-up-appear-prepare ant-slide-up ant-picker-dropdown-range ant-picker-dropdown-placement-topLeft"
|
||||
style="--arrow-x: 0px; --arrow-y: 0px; left: -1000vw; top: -1000vh; box-sizing: border-box;"
|
||||
>
|
||||
<div
|
||||
|
@ -10,7 +10,7 @@ import Form from '..';
|
||||
import { resetWarned } from '../../_util/warning';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import rtlTest from '../../../tests/shared/rtlTest';
|
||||
import { act, fireEvent, pureRender, render, screen, waitFakeTimer } from '../../../tests/utils';
|
||||
import { fireEvent, pureRender, render, screen, waitFakeTimer } from '../../../tests/utils';
|
||||
import Button from '../../button';
|
||||
import Cascader from '../../cascader';
|
||||
import Checkbox from '../../checkbox';
|
||||
@ -2262,9 +2262,8 @@ describe('Form', () => {
|
||||
|
||||
expect(container.querySelector('.ant-input-number-suffix')).toBeTruthy();
|
||||
|
||||
act(() => {
|
||||
fireEvent.focus(input);
|
||||
});
|
||||
fireEvent.focus(input);
|
||||
|
||||
expect(container.querySelector('.ant-input-number-focused')).toBeTruthy();
|
||||
|
||||
fireEvent.change(input, {
|
||||
|
@ -3,7 +3,7 @@ import React, { useState } from 'react';
|
||||
import { Col, Row } from '..';
|
||||
import mountTest from '../../../tests/shared/mountTest';
|
||||
import rtlTest from '../../../tests/shared/rtlTest';
|
||||
import { act, fireEvent, render } from '../../../tests/utils';
|
||||
import { fireEvent, render } from '../../../tests/utils';
|
||||
import useBreakpoint from '../hooks/useBreakpoint';
|
||||
|
||||
// Mock for `responsiveObserve` to test `unsubscribe` call
|
||||
@ -227,9 +227,7 @@ describe('Grid', () => {
|
||||
};
|
||||
const { container } = render(<ReactiveTest />);
|
||||
expect(container.innerHTML).toContain('ant-row-start');
|
||||
act(() => {
|
||||
fireEvent.click(container.querySelector('span')!);
|
||||
});
|
||||
fireEvent.click(container.querySelector('span')!);
|
||||
expect(container.innerHTML).toContain('ant-row-end');
|
||||
});
|
||||
|
||||
|
@ -1341,7 +1341,7 @@ describe('Upload List', () => {
|
||||
// Mock async update in a frame
|
||||
const fileNames = ['light', 'bamboo', 'little'];
|
||||
|
||||
await act(() => {
|
||||
act(() => {
|
||||
uploadRef.current.onBatchStart(
|
||||
fileNames.map((fileName) => {
|
||||
const file = new File([], fileName);
|
||||
|
Loading…
Reference in New Issue
Block a user