-
Notifications
You must be signed in to change notification settings - Fork 295
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
Refactor waitFor*
actions with resolveSelect
.
#9978
Merged
aaemnnosttv
merged 21 commits into
develop
from
enhancement/9008-remove-waitfor-actions
Jan 17, 2025
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
05c9fce
Remove the `waitForContainers()` action, add a resolver for `getWebCo…
techanvil 52e24bb
Remove the `waitForHTMLForURL()` action.
techanvil 2f1270a
Remove the `waitForPropertySummaries()` action, add a resolver for `g…
techanvil dc7719c
Remove the `waitForWebDataStreams()` action, add a resolver for `getM…
techanvil 31cda3e
Remove the `waitForExistingTag()` action.
techanvil db72f9b
Remove tests for `waitForHTMLForURL()`.
techanvil 06f851e
Remove tests for `waitForExistingTag()`.
techanvil 1a83f18
Allow `freezeMock()` to freeze multiple requests for a given matcher.
techanvil e770a7e
Fix `PropertyOrWebDataStreamNotAvailableError` test.
techanvil 4740af6
Add a test for the `getPropertySummaries()` resolver.
techanvil 367c00c
Add tests for `getMatchingWebDataStreamByPropertyID()` and `doesWebDa…
techanvil 62fe359
Update resolver test for `getWebContainers()`.
techanvil 7cea708
Fix test, revert unneeded `freezeFetch()` change.
techanvil 55d2eb9
Retrieve `getHTMLForURL()` from `resolveSelect()` outside loops.
techanvil 32de116
Add and use a resolver for `getAMPContainers()`.
techanvil f01ef5d
Add a clarifying comment to the `PropertyOrWebDataStreamNotAvailableE…
techanvil df6be4e
Tweak comment.
techanvil e32c7ce
Call resolvers unconditionally.
techanvil c049c5d
Freeze `account-summaries` request twice in test instead of mocking i…
techanvil 525d660
Rename the `freezeFetch()` utility's `times` option to `repeat`.
techanvil 7b78c6f
Fix tests.
techanvil 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
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
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
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
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
It might be more appropriate to use a secondary
waitForRegistry
here instead of an arbitrary timeout. We can always come back to it if needed though.e.g.
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.
Thanks @aaemnnosttv - I had initially tried awaiting for the existing
waitForRegistry()
again, which didn't work - I hadn't considered created a new one. That looks like a useful pattern. We could apply it to other existing cases within this test file and no doubt in numerous other places in the codebase too.site-kit-wp/assets/js/modules/analytics-4/components/setup/SetupForm.test.js
Lines 213 to 214 in 938a850
site-kit-wp/assets/js/modules/analytics-4/components/setup/SetupForm.test.js
Lines 314 to 317 in 938a850
site-kit-wp/assets/js/modules/analytics-4/components/setup/SetupForm.test.js
Lines 326 to 329 in 938a850