-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Fix exhaustive deps warning #49291
Fix exhaustive deps warning #49291
Conversation
Size Change: -1 B (0%) Total Size: 1.34 MB
ℹ️ View Unchanged
|
packages/block-library/src/navigation/edit/unsaved-inner-blocks.js
Outdated
Show resolved
Hide resolved
Flaky tests detected in 74613e5. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4502096634
|
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 tested and I didn't see this create more than one menu (i.e. it works 🎉 ).
I really think that before we merge this we need to add a quick e2e test that
- inserts a block with inners blocks as per the test instructions
- adds a new link to the block
- checks that only a single Nav Menu is in the DB.
@scruffian I added a test. It involved making some more changes to the test structure and the way we delete menus so pinging @MaggieCabrera and @jeryj who I know worked on these originally. |
This comment was marked as outdated.
This comment was marked as outdated.
17a42e1
to
8f942af
Compare
@scruffian with the rebase to include @draganescu and my recent e2e tests and the inclusion of a new e2e test in this PR to check for what happens with exisrting inner blocks the e2e tests file was a mess. Therefore I have restructured it which is why you now see a messed up diff. If the tests run and are ✅ we should be ok. |
I'm happy with the changes here but I can't approve my own PR! |
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.
My manual test was 👍 and then e2e tests I added in this PR also confirm the expected behaviour of only a single menu being created.
FYI this diff is now a mess because we had several incoming e2e test file changes in trunk
which made the test file pretty messy. I ended up resetting the file locally to match all the changes from trunk
and then replaying the test I added in this PR on top of that base. Then I reorganised the test structure so it's more logical.
What?
This adds all the dependencies to this useEffect.
Why?
We tried this once before and it had unexpected side-effects, so we reverted it. The side-effects were fixed in #48219, so we should be good to add this dependency back in.
How?
Just adds the dependency to the dependency array.
Testing Instructions
wp-admin/edit.php?post_type=wp_navigation