fix(core): disable quick search when the link-popup is visitable (#5409)

close AFF-471
This commit is contained in:
JimmFly
2024-01-04 11:36:50 +00:00
parent f5b74ca8a9
commit 971f2beed1
5 changed files with 54 additions and 7 deletions

View File

@@ -442,3 +442,30 @@ test('Create a new page with special characters in the title and search for this
await page.waitForTimeout(300);
await assertTitle(page, specialTitle);
});
test('disable quick search when the link-popup is visitable', async ({
page,
}) => {
const specialTitle = '"test"';
await openHomePage(page);
await waitForEditorLoad(page);
await clickNewPageButton(page);
await openQuickSearchByShortcut(page);
const quickSearch = page.locator('[data-testid=cmdk-quick-search]');
await expect(quickSearch).toBeVisible();
await withCtrlOrMeta(page, () => page.keyboard.press('k', { delay: 50 }));
await getBlockSuiteEditorTitle(page).click();
await getBlockSuiteEditorTitle(page).fill(specialTitle);
await page.keyboard.press('Enter', { delay: 10 });
await page.keyboard.insertText('123456');
await page.getByText('123456').dblclick();
await withCtrlOrMeta(page, () => page.keyboard.press('k', { delay: 50 }));
const linkPopup = page.locator('.affine-link-popover');
await expect(linkPopup).toBeVisible();
const currentQuickSearch = page.locator('[data-testid=cmdk-quick-search]');
await expect(currentQuickSearch).not.toBeVisible();
});

View File

@@ -54,6 +54,7 @@ function useRegisterCommands() {
],
currentLanguage: undefined,
},
editor: null,
}),
registerAffineCreationCommands({
t,