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

Mock an action response to prevent the test case sending HTTP request #7719

Merged
merged 1 commit into from
Sep 15, 2022

Conversation

crazytonyli
Copy link
Contributor

Description

This test case has been pretty flaky. In case where it passed, it took more than 2 seconds to finish. It seems to me that this test case is making an actual HTTP request from saveAddress function. Other similar test cases in this test class use testingStores.whenReceivingAction as a way to stub HTTP response, this PR adds the same code to this test case.

Testing instructions

CI jobs passes, and test_loading_indicator_gets_disabled_after_the_network_operation_completes test case takes less than 1 seconds to finish.

Screenshots

N/A


  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@crazytonyli crazytonyli added the category: unit tests Related to unit testing. label Sep 14, 2022
@crazytonyli crazytonyli added this to the 10.4 milestone Sep 14, 2022
@crazytonyli crazytonyli requested a review from mokagio September 14, 2022 06:18
@crazytonyli crazytonyli self-assigned this Sep 14, 2022
@wpmobilebot
Copy link
Collaborator

You can test the changes from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr7719-0f8ec6d on your iPhone

If you need access to App Center, please ask a maintainer to add you.

@crazytonyli
Copy link
Contributor Author

crazytonyli commented Sep 14, 2022

"0.178 seconds" in the Unit Tests execution logs should've verified this PR's fix.

[06:33:44]: ▸ ✓ test_loading_indicator_gets_disabled_after_the_network_operation_completes (0.178 seconds)

Copy link
Contributor

@mokagio mokagio left a comment

Choose a reason for hiding this comment

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

Brilliant!

@crazytonyli crazytonyli merged commit 78ddbc9 into trunk Sep 15, 2022
@crazytonyli crazytonyli deleted the fix-flaky-edit-order-address-test branch September 15, 2022 06:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: unit tests Related to unit testing.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants