Fix crash on screenshot target due to unhandled action dispatch #16352
+5
−2
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.

Found this one while trying to generate new screenshots for ASC
Description
WooCommerceScreenshots target crashes when running
testScreenshots()due to unhandled actions that are dispatched throughMockActionHandlerOne review is enough. No rush to review/merge into 23.7, it's an internal crash only when we run the target, which doesn't run in CI 👍
Test Steps
WooCommerceScreenshotsWooCommerceScreenshots.testScreenshots()* The first time I ran the tests all of them failed due to a Tap to Pay modal appearing in the middle of the screen, which wasn't dismissed automatically so tests couldn't navigate through the app to make screenshots. A second run worked fine. I'm guessing because we only show it once, but I'm unaware of the exact details at this point. If tests fail due to this reason please run them again, we can handle the tap to pay modal separately.