Skip to content

Commit ffda15d

Browse files
gaearonjetoneza
authored andcommitted
Fix test to use AsyncMode
Addresses one of the issues brought up by @NE-SmallTown in facebook#13488 (comment)
1 parent 3e20c92 commit ffda15d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/react-dom/src/__tests__/ReactDOMFiberAsync-test.internal.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ describe('ReactDOMFiberAsync', () => {
8585
this.setState({
8686
asyncValue: nextValue,
8787
});
88+
// It should not be flushed yet.
89+
expect(asyncValueRef.current.textContent).toBe('');
8890
});
8991
this.setState({
9092
syncValue: nextValue,
@@ -105,7 +107,12 @@ describe('ReactDOMFiberAsync', () => {
105107
);
106108
}
107109
}
108-
ReactDOM.render(<Counter />, container);
110+
ReactDOM.render(
111+
<AsyncMode>
112+
<Counter />
113+
</AsyncMode>,
114+
container,
115+
);
109116
expect(asyncValueRef.current.textContent).toBe('');
110117
expect(syncValueRef.current.textContent).toBe('');
111118

0 commit comments

Comments
 (0)