Skip to content

Commit

Permalink
@nocommit React Native sync for revisions 1159ff6...34aa5cf
Browse files Browse the repository at this point in the history
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 ([facebook#24166](facebook/react#24166)) //<salazarm>//
- **[6b85823b3](facebook/react@6b85823b3 )**: Clean up Selective Hydration / Event Replay flag ([facebook#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
  • Loading branch information
rickhanlonii authored and Saadnajmi committed Jan 14, 2023
1 parent 2da10ba commit 5d8cfd6
Show file tree
Hide file tree
Showing 12 changed files with 19,768 additions and 17,224 deletions.
41 changes: 21 additions & 20 deletions Libraries/Components/TextInput/__tests__/TextInput-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ const ReactTestRenderer = require('react-test-renderer');
const TextInput = require('../TextInput');
const ReactNative = require('../../../Renderer/shims/ReactNative');

import Component from '@reactions/component';

const {
enter,
expectRendersMatchingSnapshot,
Expand All @@ -33,23 +31,24 @@ describe('TextInput tests', () => {
inputRef = React.createRef(null);
onChangeListener = jest.fn();
onChangeTextListener = jest.fn();
const renderTree = ReactTestRenderer.create(
<Component initialState={{text: initialValue}}>
{({setState, state}) => (
<TextInput
ref={inputRef}
value={state.text}
onChangeText={text => {
onChangeTextListener(text);
setState({text});
}}
onChange={event => {
onChangeListener(event);
}}
/>
)}
</Component>,
);
function TextInputWrapper() {
const [state, setState] = React.useState({text: initialValue});

return (
<TextInput
ref={inputRef}
value={state.text}
onChangeText={text => {
onChangeTextListener(text);
setState({text});
}}
onChange={event => {
onChangeListener(event);
}}
/>
);
}
const renderTree = ReactTestRenderer.create(<TextInputWrapper />);
input = renderTree.root.findByType(TextInput);
});
it('has expected instance functions', () => {
Expand All @@ -71,7 +70,9 @@ describe('TextInput tests', () => {
it('calls onChange callbacks', () => {
expect(input.props.value).toBe(initialValue);
const message = 'This is a test message';
enter(input, message);
ReactTestRenderer.act(() => {
enter(input, message);
});
expect(input.props.value).toBe(message);
expect(onChangeTextListener).toHaveBeenCalledWith(message);
expect(onChangeListener).toHaveBeenCalledWith({
Expand Down
6 changes: 5 additions & 1 deletion Libraries/Lists/__tests__/VirtualizedList-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1116,6 +1116,8 @@ it('retains batch render region when an item is appended', () => {
performAllBatches();
});

jest.runAllTimers();

ReactTestRenderer.act(() => {
component.update(
<VirtualizedList
Expand Down Expand Up @@ -1365,6 +1367,7 @@ it('renders windowSize derived region at top', () => {
performAllBatches();
});

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

jest.runAllTimers();
// A windowSize of 3 means that we should render a viewport's worth of content
// above and below the current. A 20 dip viewport in the top of the list means
// we should render the 6 10-dip items (for the current viewport, 20 dip above
Expand Down Expand Up @@ -1434,12 +1438,12 @@ it('renders windowSize derived region at bottom', () => {
});
performAllBatches();
});

ReactTestRenderer.act(() => {
simulateScroll(component, {x: 0, y: 80});
performAllBatches();
});

jest.runAllTimers();
// A windowSize of 3 means that we should render a viewport's worth of content
// above and below the current. A 20 dip viewport at the bottom of the list
// means we should render the bottom 4 10-dip items (for the current viewport,
Expand Down
2 changes: 1 addition & 1 deletion Libraries/Renderer/REVISION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1159ff6193d500046d7bb86c234e167ea4b0becb
34aa5cfe0d9b6ec4667e02bf46ab34d83dfb2d6d
Loading

0 comments on commit 5d8cfd6

Please sign in to comment.