-
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
Testing: Add E2E test for inserting reusable blocks by inserter after page refresh #9962
Comments
Workaround: The reusable blocks appear correctly when the Inserter is closed and reopened again. It appears to hint to a possible race condition on this logic: gutenberg/packages/editor/src/store/effects/reusable-blocks.js Lines 55 to 60 in 0816e23
cc @youknowriad Does any of this sound familiar? Perhaps related to recent work in #9732? |
I'd suggest we approach this from a TDD angle, updating the E2E reusable block insertion case to a failing state and working backward to a resolution. Based on the above workaround, I expect it may start failing if we ensured a fresh post for each test case run, i.e. using |
the recent changes have been merged after the 3.9 RC, so while it's related, I think the issue was there before. |
I checked out a detached head at both |
Oh sorry, I'm tired, I thought you were linking to the resolvers refactoring that was recently merged. I can take a look at this issue tomorrow hopefully. |
Reopening as we should have an end-to-end test. |
I think we do have an e2e test, what's missing is an e2e test inserting a reusable block after refreshing the page. |
Yes, the test was obviously not solid enough, based on the presence of the bug. I'd say in general we should have each and every test case working from a new post†. † I think there's still some room to optimize here, if performance is a concern. Artificially resetting the editor state to its initial value without actually triggering a reload. |
Experimenting with this, we've encountered some other issues to do with tab focusing that interfere with the tests. Tab behaviour is different when starting with a new post for unknown reasons. We're investigating that further. |
To avoid repeated regressions, we should include an end-to-end test for inserting a reusable block by Inserter in a fresh editor page. See #9962 (comment) .
Original Regression:
Describe the bug
Reusable blocks are not shown in the Inserter.
To Reproduce
Expected behavior
Reusable block is both shown and searchable.
Additional context
Slack mentions:
From @youknowriad:
The text was updated successfully, but these errors were encountered: