mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-14 05:14:54 +00:00
fix(core): disable quick search when the link-popup is visitable (#5409)
close AFF-471
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
||||
@@ -54,6 +54,7 @@ function useRegisterCommands() {
|
||||
],
|
||||
currentLanguage: undefined,
|
||||
},
|
||||
editor: null,
|
||||
}),
|
||||
registerAffineCreationCommands({
|
||||
t,
|
||||
|
||||
Reference in New Issue
Block a user