Skip to content

Commit 41cbccd

Browse files
rickhanloniifacebook-github-bot
authored andcommitted
@nocommit React Native sync for revisions 1159ff6...34aa5cf
Summary: I'm kicking this off to see what's the extent of failures we're going to get if we try to bump to React 18 inside RN OSS. This sync includes the following changes: - **[34aa5cfe0](facebook/react@34aa5cfe0 )**: Update local package.jsons for 18 //<Andrew Clark>// - **[e7d0053e6](facebook/react@e7d0053e6 )**: [fizz] Fix validateIterable call ([#24166](facebook/react#24166)) //<salazarm>// - **[6b85823b3](facebook/react@6b85823b3 )**: Clean up Selective Hydration / Event Replay flag ([#24156](facebook/react#24156)) //<salazarm>// Changelog: [General][Changed] - React Native sync for revisions 1159ff6...34aa5cf jest_e2e[run_all_tests] Reviewed By: cortinico Differential Revision: D35504622 fbshipit-source-id: ad0f6b42b6e03d78cd5d6ba51ce5a5730d25b167
1 parent 2c87b74 commit 41cbccd

12 files changed

+19764
-17220
lines changed

Libraries/Components/TextInput/__tests__/TextInput-test.js

+21-20
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ const ReactTestRenderer = require('react-test-renderer');
1414
const TextInput = require('../TextInput');
1515
const ReactNative = require('../../../Renderer/shims/ReactNative');
1616

17-
import Component from '@reactions/component';
18-
1917
const {
2018
enter,
2119
expectRendersMatchingSnapshot,
@@ -33,23 +31,24 @@ describe('TextInput tests', () => {
3331
inputRef = React.createRef(null);
3432
onChangeListener = jest.fn();
3533
onChangeTextListener = jest.fn();
36-
const renderTree = ReactTestRenderer.create(
37-
<Component initialState={{text: initialValue}}>
38-
{({setState, state}) => (
39-
<TextInput
40-
ref={inputRef}
41-
value={state.text}
42-
onChangeText={text => {
43-
onChangeTextListener(text);
44-
setState({text});
45-
}}
46-
onChange={event => {
47-
onChangeListener(event);
48-
}}
49-
/>
50-
)}
51-
</Component>,
52-
);
34+
function TextInputWrapper() {
35+
const [state, setState] = React.useState({text: initialValue});
36+
37+
return (
38+
<TextInput
39+
ref={inputRef}
40+
value={state.text}
41+
onChangeText={text => {
42+
onChangeTextListener(text);
43+
setState({text});
44+
}}
45+
onChange={event => {
46+
onChangeListener(event);
47+
}}
48+
/>
49+
);
50+
}
51+
const renderTree = ReactTestRenderer.create(<TextInputWrapper />);
5352
input = renderTree.root.findByType(TextInput);
5453
});
5554
it('has expected instance functions', () => {
@@ -71,7 +70,9 @@ describe('TextInput tests', () => {
7170
it('calls onChange callbacks', () => {
7271
expect(input.props.value).toBe(initialValue);
7372
const message = 'This is a test message';
74-
enter(input, message);
73+
ReactTestRenderer.act(() => {
74+
enter(input, message);
75+
});
7576
expect(input.props.value).toBe(message);
7677
expect(onChangeTextListener).toHaveBeenCalledWith(message);
7778
expect(onChangeListener).toHaveBeenCalledWith({

Libraries/Lists/__tests__/VirtualizedList-test.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1116,6 +1116,8 @@ it('retains batch render region when an item is appended', () => {
11161116
performAllBatches();
11171117
});
11181118

1119+
jest.runAllTimers();
1120+
11191121
ReactTestRenderer.act(() => {
11201122
component.update(
11211123
<VirtualizedList
@@ -1365,6 +1367,7 @@ it('renders windowSize derived region at top', () => {
13651367
performAllBatches();
13661368
});
13671369

1370+
jest.runAllTimers();
13681371
// A windowSize of 3 means that we should render a viewport's worth of content
13691372
// above and below the current. A 20 dip viewport at the top of the list means
13701373
// we should render the top 4 10-dip items (for the current viewport, and
@@ -1402,6 +1405,7 @@ it('renders windowSize derived region in middle', () => {
14021405
performAllBatches();
14031406
});
14041407

1408+
jest.runAllTimers();
14051409
// A windowSize of 3 means that we should render a viewport's worth of content
14061410
// above and below the current. A 20 dip viewport in the top of the list means
14071411
// we should render the 6 10-dip items (for the current viewport, 20 dip above
@@ -1434,12 +1438,12 @@ it('renders windowSize derived region at bottom', () => {
14341438
});
14351439
performAllBatches();
14361440
});
1437-
14381441
ReactTestRenderer.act(() => {
14391442
simulateScroll(component, {x: 0, y: 80});
14401443
performAllBatches();
14411444
});
14421445

1446+
jest.runAllTimers();
14431447
// A windowSize of 3 means that we should render a viewport's worth of content
14441448
// above and below the current. A 20 dip viewport at the bottom of the list
14451449
// means we should render the bottom 4 10-dip items (for the current viewport,

Libraries/Renderer/REVISION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1159ff6193d500046d7bb86c234e167ea4b0becb
1+
34aa5cfe0d9b6ec4667e02bf46ab34d83dfb2d6d

0 commit comments

Comments
 (0)