Fixed sporadic BeginRefundRequestHelperTests failures#1390
Merged
Conversation
aboedo
approved these changes
Mar 14, 2022
af3f089 to
b812108
Compare
b7dac44 to
44711a7
Compare
These have began failing on #1387, even though that doesn't change anything that should affect the `UIWindowScene` or anything related. This could have been a regression from Xcode 13.3. When the test fails (which isn't always), the scene isn't yet `.foregroundActive` . To workaround that, this defaults to any scene, *though only when running tests, on debug, and on the simulator*. So nothing is changed in release or device builds. This also has a small refactor on `BeginRefundRequestHelperTests` to move the test data below and make the tests more readable. Additionally, the `MockSK2BeginRefundRequestHelper` is recreated for every test. I thought initially that this is what was making the test fail, as the mock expectations and state was being shared across tests. It's not, but now that should remove any potential issues with shared state.
44711a7 to
874a168
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
These have began failing on #1387, even though that doesn't change anything that should affect the
UIWindowSceneor anything related. This could have been a regression from Xcode 13.3.When the test fails (which isn't always), the scene isn't yet
.foregroundActive. To workaround that, this defaults to any scene, though only when running tests, on debug, and on the simulator. So nothing is changed in release or device builds.This also has a small refactor on
BeginRefundRequestHelperTeststo move the test data below and make the tests more readable.Additionally, the
MockSK2BeginRefundRequestHelperis recreated for every test. I thought initially that this is what was making the test fail, as the mock expectations and state was being shared across tests. It's not, but now that should remove any potential issues with shared state.