Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RNMobile] Upgrade React Native 0.71.11 #51303

Merged
merged 70 commits into from
Jul 27, 2023
Merged
Changes from 1 commit
Commits
Show all changes
70 commits
Select commit Hold shift + click to select a range
c70eb5b
Upgrade `react-native` dependency
fluiddot Jun 5, 2023
13ad608
Upgrade `@babel/runtime` dependency
fluiddot Jun 5, 2023
83b7a16
Upgrade `metro-react-native-babel` preset and transformer dependencies
fluiddot Jun 5, 2023
256be9c
Upgrade `cocoapods` gem
fluiddot Jun 5, 2023
213073d
Re-apply `react-devtools-core` patch to new version
fluiddot Jun 5, 2023
cbdb7ff
Update jest snapshots with new a11y values
fluiddot Jun 8, 2023
bd0750b
Mock `Linking.addEventListener` function
fluiddot Jun 8, 2023
6cac580
Update tests that fail due to use of debounce and link suggestions
fluiddot Jun 8, 2023
311ed3f
Fix `MediaUpload` component test
fluiddot Jun 8, 2023
5b48573
Update `@react-navigation/native` package to version `6.0.14`
fluiddot Jun 8, 2023
ba8496a
Update `react-native-reanimated` to version `2.17.0`
fluiddot Jun 8, 2023
ca395c2
Update `react-native-gesture-handler` to version `2.10.2`
fluiddot Jun 8, 2023
2c0e048
Fix `act` warnings produced during block insertion
fluiddot Jun 9, 2023
809b82d
Fix `act` warnings in Columns block tests
fluiddot Jun 9, 2023
3f73574
Fix `act` warnings in List block tests
fluiddot Jun 9, 2023
e0cab59
Upgrade `react-native` dependency to version `0.71.11`
fluiddot Jun 16, 2023
97265c7
Mock return value of Linking `addEventListener`
fluiddot Jun 16, 2023
9f2edf4
Remove `waitForModalVisible` usage in Paragraph block tests
fluiddot Jun 16, 2023
a9d4165
Remove `waitFor` usage in Link settings tests
fluiddot Jun 16, 2023
70dbcc6
test: Fix act warning by awaiting LinkPicker loading indicator removal
dcalhoun Jun 17, 2023
36ccef4
build: Update react-native-safe-area-context to 4.6.3
dcalhoun Jun 22, 2023
29457bb
build: Upgrade react-native-screens to 3.22.0
dcalhoun Jun 22, 2023
88b679b
build: Upgrade react-native-svg to 13.9.0
dcalhoun Jun 22, 2023
53ea3f9
build: Upgrade @react-native-masked-view/masked-view to 0.2.9
dcalhoun Jun 22, 2023
6d30809
build: Upgrade @react-native-clipboard/clipboard to 1.11.2
dcalhoun Jun 22, 2023
5be8a68
build: Upgrade react-native-modal to 13.0.1
dcalhoun Jun 22, 2023
ac7d100
Merge branch 'trunk' of github.com:WordPress/gutenberg into rnmobile/…
dcalhoun Jun 26, 2023
8bbaf2c
test: Update link modal snapshot
dcalhoun Jun 26, 2023
b5c02fd
Update `@react-navigation/stack` to version `6.3.5`
fluiddot Jun 27, 2023
556b3ef
Upgrade `react-native-linear-gradient` to version `2.7.3`
fluiddot Jun 28, 2023
fb14804
Use `react-native-safe-area-context` mock provided by the library
fluiddot Jun 28, 2023
70a78c5
Merge branch 'trunk' into rnmobile/upgrade/react-native-0.71.8
fluiddot Jun 28, 2023
7988b0e
Update link modal snapshot
fluiddot Jun 28, 2023
a756c3e
Update `package-lock.json` file
fluiddot Jun 28, 2023
e5838f4
Disable `react-native-screens` in navigators
fluiddot Jun 27, 2023
f879e29
Fix render order of animated view to highlight selected segment
fluiddot Jun 27, 2023
86d36e0
Update source of `react-native-hsv-color-picker` to use tag version
fluiddot Jun 28, 2023
8f36b9a
Revert "Update link modal snapshot"
fluiddot Jun 28, 2023
305db7f
[RNMobile] Upgrade React Native `0.71.11` - iOS changes (#51386)
fluiddot Jun 30, 2023
39570ce
[RNMobile] Upgrade React Native `0.71.11` - Android changes (#51289)
fluiddot Jun 30, 2023
ad188ac
Avoid exception in E2E tests when typing an empty string on Android
fluiddot Jun 30, 2023
9b8d7be
Update a11y id queries for Android E2E tests
fluiddot Jun 30, 2023
de27968
Update button inline appender query for Android E2E tests
fluiddot Jun 30, 2023
b6f5fba
Unify press keycode function for E2E tests
fluiddot Jul 3, 2023
bb3afd8
Update comments in functions related to pressing a keycode
fluiddot Jul 4, 2023
bdd4704
Update block drop position using Reanimated's shared value
fluiddot Jul 4, 2023
2b3fa44
Merge branch 'trunk' into rnmobile/upgrade/react-native-0.71.8
fluiddot Jul 4, 2023
643860d
Remove unneeded `hidden` param in Paragraph block test case
fluiddot Jul 4, 2023
cf67f49
Revert removing `.ruby-version` file
fluiddot Jul 5, 2023
a5036dd
Add inline comment in Reanimated patch
fluiddot Jul 5, 2023
70c6dcb
Use `waitForElementToBeRemoved` in Paragraph block test cases
fluiddot Jul 5, 2023
2d0a219
Remove `act` statements from Link Settings test cases
fluiddot Jul 5, 2023
470af37
fix: Cover focal point drag handle visibility
dcalhoun Jul 6, 2023
0411df1
[RNMobile] Use Reanimated in bottom sheet height animation (#52563)
fluiddot Jul 14, 2023
4482b9d
Merge branch 'trunk' into rnmobile/upgrade/react-native-0.71.8
fluiddot Jul 19, 2023
1f34e0c
Update `react-native-editor` changelog
fluiddot Jul 19, 2023
20aaaf3
Merge branch 'trunk' into rnmobile/upgrade/react-native-0.71.8
fluiddot Jul 19, 2023
2fad54c
Merge branch 'trunk' into rnmobile/upgrade/react-native-0.71.8
Jul 20, 2023
44b988a
Merge branch 'trunk' into rnmobile/upgrade/react-native-0.71.8
fluiddot Jul 21, 2023
0c79d79
Drop unsupported `--no-jetifier` from Android cmd
Jul 21, 2023
fff11e9
Merge branch 'trunk' into rnmobile/upgrade/react-native-0.71.8
Jul 21, 2023
8e496ba
Revert accidental change to .ruby-version
Jul 21, 2023
7b423cd
Restore correct dependencies to package-lock.json
Jul 21, 2023
7289045
Update `react-native-editor` changelog
fluiddot Jul 26, 2023
3ef9edd
Merge branch 'trunk' into rnmobile/upgrade/react-native-0.71.8
fluiddot Jul 26, 2023
05e9748
Merge branch 'trunk' into rnmobile/upgrade/react-native-0.71.8
fluiddot Jul 26, 2023
c6b1311
Update `package-lock.json` file to revert previous conflict resolutions
fluiddot Jul 26, 2023
29c2bed
Re-apply `react-devtools-core` patch to new version
fluiddot Jul 26, 2023
61669c8
Update `Podfile.lock` file
fluiddot Jul 26, 2023
5040e6a
Merge branch 'trunk' of github.com:WordPress/gutenberg into rnmobile/…
dcalhoun Jul 26, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion test/native/integration-test-helpers/add-block.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,19 @@ export const addBlock = async (
},
} );

fireEvent.press( await waitFor( () => getByText( blockName ) ) );
const blockButton = await waitFor( () => getByText( blockName ) );
// Blocks can perform belated state updates after they are inserted.
// To avoid potential `act` warnings, we ensure that all timers and queued
// microtasks are executed.
await withFakeTimers( async () => {
fireEvent.press( blockButton );
// Run all timers, in case any performs a state updates.
// Column block example: https://t.ly/NjTs
act( () => jest.runOnlyPendingTimers() );
Comment on lines +50 to +52
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am hesitant to await this nuanced UI logic in a test helper. This feels like something that should be accounted for within the Columns test file.

I am unaware of a specific example right now, but I could see abstracting the timers to this top-level helper confusing future test writers. E.g. if my subject block transitions from one state to another over a period of time, i.e. with setTimeout, this global helper would prevent me from asserting (or simply understanding and recognizing) that transition.

Are there act examples outside of the Column block of which you are aware? Does it make sense to relocate this to the block tests that need it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't checked if other blocks use timers to update their local state when created. I agree that, if this is only needed for a specific block, we could execute in the associated test files instead of in a generic way.

My purpose with this approach was to simplify the block insertion, as I feel that it won't be very common to assert potential state updates that happen during the insertion. I assumed that all of them acted as part of the addBlock helper. However, in case we need to, we could run the timers conditionally via a configuration parameter.

I'll check if this is needed in more blocks, and depending on that, we could decide if we rather run the timers generally here or in each test 👍 .

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your expressed purpose makes a lot of sense. I recognize that our testing environment needs to find a balance between convenience and comprehensibility.

To be clear, I am not opposed to inserting this global timer into the addBlock helper. I merely wanted to note its potential for breeding confusion due to the obscure nature of this timers run. The inline comments will likely help to mitigate that, provided the test author reads the source of addBlock when using it.

Please feel free to leave this implementation as-is. A configuration parameter could arguably be unnecessary complexity.

// Let potential queued microtasks (like Promises) to be executed.
// Inner blocks example: https://t.ly/b95nA
await act( async () => {} );
Comment on lines +53 to +55
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From reviewing the example inner block state changes, it makes sense to abstract this microtask flush, from my perspective.

The changing state is already abstract, not incredibly block-specific, and does not always result in changes that are queryable in the UI.

Setting Type Queryable Result
allowedBlocks WPBlockType[] Seemingly unavailable.
orientation "vertical" | "horizontal" Block mover arrows.
prioritizedInserterBlocks WPBlockType[] Seemingly unavailable
templateLock boolean Lock icon?

} );
fluiddot marked this conversation as resolved.
Show resolved Hide resolved

// On iOS the action for inserting a block is delayed (https://bit.ly/3AVALqH).
// Hence, we need to wait for the different steps until the the block is inserted.
Expand Down