Skip to content

Commit cd43d12

Browse files
committed
Move act to wrap the event
1 parent 9545f0f commit cd43d12

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

packages/react-dom/src/__tests__/ReactDOMHooks-test.js

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -134,15 +134,13 @@ describe('ReactDOMHooks', () => {
134134
Scheduler.unstable_flushAll();
135135

136136
inputRef.current.value = 'abc';
137-
inputRef.current.dispatchEvent(
138-
new Event('input', {
139-
bubbles: true,
140-
cancelable: true,
141-
}),
142-
);
143-
144137
await act(async () => {
145-
Scheduler.unstable_flushAll();
138+
inputRef.current.dispatchEvent(
139+
new Event('input', {
140+
bubbles: true,
141+
cancelable: true,
142+
}),
143+
);
146144
});
147145

148146
expect(labelRef.current.innerHTML).toBe('abc');

0 commit comments

Comments
 (0)