-
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 navigation editor link search suggestions #29707
Conversation
Size Change: +5 B (0%) Total Size: 1.39 MB
ℹ️ View Unchanged
|
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.
Tested and fixes the regression. Great that we have a test for this now :)
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 @talldan this tests well for me! This is good to land once the E2Es are fixed (or put into a follow up PR).
navigation-editor.mp4
Running npm run test-e2e -- --puppeteer-interactive packages/e2e-tests/specs/experiments/navigation-editor.test.js
locally I see
● Navigation editor › displays suggestions when adding a link
TimeoutError: waiting for selector `button[aria-label="Add Link"]` failed: timeout 30000ms exceeded
349 |
350 | // Add an inner link block.
> 351 | const appender = await page.waitForSelector(
| ^
352 | 'button[aria-label="Add Link"]'
353 | );
354 | await appender.click();
@@ -282,4 +328,60 @@ describe( 'Navigation editor', () => { | |||
} ); | |||
expect( submenuLinkHidden ).toBeDefined(); | |||
} ); | |||
|
|||
it( 'displays suggestions when adding a link', async () => { |
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 for adding an additional e2e test here
@gwwar Thanks for reviewing. Yep, I'm having trouble getting the new end to end test to pass. When running on CI, the Navigation Link block seems to have no variations. Clicking the appender inserts the block directly rather than opening the quick inserter menu. If you revert the changes in 88068a7 it should run well locally, but fails in CI. Slightly baffled by this 🤔 |
88068a7
to
e76f117
Compare
e76f117
to
b17a39e
Compare
I've updated the test to work for no variations, but this means it won't pass locally. Would be good to understand what's happening here. |
Curious 🤔 @talldan one thing I changed recently was moving the fallback hardcoded variations to the gutenberg/packages/block-library/src/navigation-link/hooks.js Lines 71 to 75 in 647a41c
|
The bit that's unusual is that it works fine locally, the setup should be exactly the same. I thought it might be that one of the test plugins was somehow staying active, but I've tested those locally and couldn't see any issues. But it could still be another test leaving behind some stray configuration. |
Description
#29012 caused a regression in the link suggestions for the navigation editor, resulting in some very long failing HTTP requests:
The line of code that cause the issue is:
https://github.com/WordPress/gutenberg/pull/29012/files#diff-8b871841ffe5cb86e63dd3e6df4e2230028ca02ff8ecebad37fac39cf5aa2b99R29-R30
This provided no way for the search text or search options to be passed into the
fetchLinkSuggestions
function. It's remedied in this PR.How has this been tested?
Screenshots
Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist: