-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
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 13ad608
Upgrade `@babel/runtime` dependency
fluiddot 83b7a16
Upgrade `metro-react-native-babel` preset and transformer dependencies
fluiddot 256be9c
Upgrade `cocoapods` gem
fluiddot 213073d
Re-apply `react-devtools-core` patch to new version
fluiddot cbdb7ff
Update jest snapshots with new a11y values
fluiddot bd0750b
Mock `Linking.addEventListener` function
fluiddot 6cac580
Update tests that fail due to use of debounce and link suggestions
fluiddot 311ed3f
Fix `MediaUpload` component test
fluiddot 5b48573
Update `@react-navigation/native` package to version `6.0.14`
fluiddot ba8496a
Update `react-native-reanimated` to version `2.17.0`
fluiddot ca395c2
Update `react-native-gesture-handler` to version `2.10.2`
fluiddot 2c0e048
Fix `act` warnings produced during block insertion
fluiddot 809b82d
Fix `act` warnings in Columns block tests
fluiddot 3f73574
Fix `act` warnings in List block tests
fluiddot e0cab59
Upgrade `react-native` dependency to version `0.71.11`
fluiddot 97265c7
Mock return value of Linking `addEventListener`
fluiddot 9f2edf4
Remove `waitForModalVisible` usage in Paragraph block tests
fluiddot a9d4165
Remove `waitFor` usage in Link settings tests
fluiddot 70dbcc6
test: Fix act warning by awaiting LinkPicker loading indicator removal
dcalhoun 36ccef4
build: Update react-native-safe-area-context to 4.6.3
dcalhoun 29457bb
build: Upgrade react-native-screens to 3.22.0
dcalhoun 88b679b
build: Upgrade react-native-svg to 13.9.0
dcalhoun 53ea3f9
build: Upgrade @react-native-masked-view/masked-view to 0.2.9
dcalhoun 6d30809
build: Upgrade @react-native-clipboard/clipboard to 1.11.2
dcalhoun 5be8a68
build: Upgrade react-native-modal to 13.0.1
dcalhoun ac7d100
Merge branch 'trunk' of github.com:WordPress/gutenberg into rnmobile/…
dcalhoun 8bbaf2c
test: Update link modal snapshot
dcalhoun b5c02fd
Update `@react-navigation/stack` to version `6.3.5`
fluiddot 556b3ef
Upgrade `react-native-linear-gradient` to version `2.7.3`
fluiddot fb14804
Use `react-native-safe-area-context` mock provided by the library
fluiddot 70a78c5
Merge branch 'trunk' into rnmobile/upgrade/react-native-0.71.8
fluiddot 7988b0e
Update link modal snapshot
fluiddot a756c3e
Update `package-lock.json` file
fluiddot e5838f4
Disable `react-native-screens` in navigators
fluiddot f879e29
Fix render order of animated view to highlight selected segment
fluiddot 86d36e0
Update source of `react-native-hsv-color-picker` to use tag version
fluiddot 8f36b9a
Revert "Update link modal snapshot"
fluiddot 305db7f
[RNMobile] Upgrade React Native `0.71.11` - iOS changes (#51386)
fluiddot 39570ce
[RNMobile] Upgrade React Native `0.71.11` - Android changes (#51289)
fluiddot ad188ac
Avoid exception in E2E tests when typing an empty string on Android
fluiddot 9b8d7be
Update a11y id queries for Android E2E tests
fluiddot de27968
Update button inline appender query for Android E2E tests
fluiddot b6f5fba
Unify press keycode function for E2E tests
fluiddot bb3afd8
Update comments in functions related to pressing a keycode
fluiddot bdd4704
Update block drop position using Reanimated's shared value
fluiddot 2b3fa44
Merge branch 'trunk' into rnmobile/upgrade/react-native-0.71.8
fluiddot 643860d
Remove unneeded `hidden` param in Paragraph block test case
fluiddot cf67f49
Revert removing `.ruby-version` file
fluiddot a5036dd
Add inline comment in Reanimated patch
fluiddot 70c6dcb
Use `waitForElementToBeRemoved` in Paragraph block test cases
fluiddot 2d0a219
Remove `act` statements from Link Settings test cases
fluiddot 470af37
fix: Cover focal point drag handle visibility
dcalhoun 0411df1
[RNMobile] Use Reanimated in bottom sheet height animation (#52563)
fluiddot 4482b9d
Merge branch 'trunk' into rnmobile/upgrade/react-native-0.71.8
fluiddot 1f34e0c
Update `react-native-editor` changelog
fluiddot 20aaaf3
Merge branch 'trunk' into rnmobile/upgrade/react-native-0.71.8
fluiddot 2fad54c
Merge branch 'trunk' into rnmobile/upgrade/react-native-0.71.8
44b988a
Merge branch 'trunk' into rnmobile/upgrade/react-native-0.71.8
fluiddot 0c79d79
Drop unsupported `--no-jetifier` from Android cmd
fff11e9
Merge branch 'trunk' into rnmobile/upgrade/react-native-0.71.8
8e496ba
Revert accidental change to .ruby-version
7b423cd
Restore correct dependencies to package-lock.json
7289045
Update `react-native-editor` changelog
fluiddot 3ef9edd
Merge branch 'trunk' into rnmobile/upgrade/react-native-0.71.8
fluiddot 05e9748
Merge branch 'trunk' into rnmobile/upgrade/react-native-0.71.8
fluiddot c6b1311
Update `package-lock.json` file to revert previous conflict resolutions
fluiddot 29c2bed
Re-apply `react-devtools-core` patch to new version
fluiddot 61669c8
Update `Podfile.lock` file
fluiddot 5040e6a
Merge branch 'trunk' of github.com:WordPress/gutenberg into rnmobile/…
dcalhoun File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -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() ); | |||||||||||||||||
// 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
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
|
|||||||||||||||||
} ); | |||||||||||||||||
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. | |||||||||||||||||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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?There was a problem hiding this comment.
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 👍 .
There was a problem hiding this comment.
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 ofaddBlock
when using it.Please feel free to leave this implementation as-is. A configuration parameter could arguably be unnecessary complexity.