-
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
Improve openAllBlockInserterCategories function; #14460
Improve openAllBlockInserterCategories function; #14460
Conversation
…lures in inner-blocks-allowed-blocks.test.js.
30e82f4
to
7556bf2
Compare
To my understanding, for some reasons the name of this branch
|
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 can confirm that it solves the original issue. I'm not 100% confident about using while
loop but maybe it's okay given that Jest sets a timeout for each test.
await categoryPanel.click(); | ||
categoryPanel = await page.$( notOppenedCategorySelector ); |
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.
How about we keep the for of
loop and we wait until it has is-opened
class applied? I never feel confident about using while loop :)
I'm not sure to be honest, maybe this is okay since it has to await
and would timeout anyways.
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 think this approach would still be problematic, because if we used the selector '.block-editor-inserter__results .components-panel__body' in a for of, as soon as we applied the first click, all the other selectors would be invalid, because they reference an element that no longer exists on the dom because of a rerender that happens on click so we would not be able to use the element to wait for a class.
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.
Yeah, it's a complex stuff :)
Merging this so we can delete the branch and avoid problems like the one referred by @afercia. If anyone has more thoughts on this I will gladly iterate. |
…lures in inner blocks allowed blocks test. (#14460)
…lures in inner blocks allowed blocks test. (#14460)
Fix intermittent failures in inner-blocks-allowed-blocks.test.js.
How has this been tested?
The best method seems to be executing this test in Travis CI multiple times and check that the tests don't fail.