-
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 Nav block lower permission user tests by removing expectation of REST errors #42556
Conversation
These errors were avoided in #42413
Size Change: 0 B Total Size: 1.26 MB ℹ️ View Unchanged
|
@getdave, it looks like the Navigation block also triggers 403. |
Can we avoid this now? From my vague memories of working on this it was difficult or impossible to avoid this because there was no way to determine the permissions ahead of making the request for this specific case. |
Yes but mostly it's necessary to manipulate the data. For example, if I"m fetching menu X then the UI expects to allow you to edit it. There's no currently a fool proof way to disable block editing (i.e. "inert" blocks) and so we can use We could use it to fetch the list of existing menus however. But that's still only one request. |
It makes sense that we need the I guess we'll have to use a mixed approach, use the |
These tests are going to be rewritten so I'll close this one out. |
What?
Fixes Nav block user permissions tests by removing expectation that certain REST API endpoints will
403
for lower permission users.Why?
I noticed #37604 was reopened (again) and I think this is because the REST errors were removed in #42413. As the requests no longer fire we don't need to expect errors in the tests.
How?
Removes the
toHaveErrored()
assertion to cover:Testing Instructions
Re-run the CI tests a few times and ensure that the following test does not fail:
gutenberg/packages/e2e-tests/specs/editor/blocks/navigation.test.js
Line 1320 in 80c536c
Screenshots or screencast