mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-25 06:18:45 +08:00
fix(core): flaky quick search test (#11833)
This commit is contained in:
@@ -464,6 +464,8 @@ test('can use @ to open quick search to search for doc and insert into canvas',
|
|||||||
|
|
||||||
const url = page.url();
|
const url = page.url();
|
||||||
|
|
||||||
|
const docTitle = await page.getByTestId('title-edit-button').innerText();
|
||||||
|
|
||||||
await clickNewPageButton(page);
|
await clickNewPageButton(page);
|
||||||
await clickEdgelessModeButton(page);
|
await clickEdgelessModeButton(page);
|
||||||
await page.locator('affine-edgeless-root').press('@');
|
await page.locator('affine-edgeless-root').press('@');
|
||||||
@@ -475,7 +477,9 @@ test('can use @ to open quick search to search for doc and insert into canvas',
|
|||||||
await insertInputText(page, url);
|
await insertInputText(page, url);
|
||||||
|
|
||||||
// expect the default page to be selected
|
// expect the default page to be selected
|
||||||
await expect(page.locator('[cmdk-group-items] [cmdk-item]')).toHaveCount(5);
|
await expect(
|
||||||
|
page.locator('[cmdk-group-items] [cmdk-item][data-selected="true"]')
|
||||||
|
).toContainText(docTitle);
|
||||||
|
|
||||||
// press enter to insert the page to canvas
|
// press enter to insert the page to canvas
|
||||||
await page.keyboard.press('Enter');
|
await page.keyboard.press('Enter');
|
||||||
@@ -484,7 +488,7 @@ test('can use @ to open quick search to search for doc and insert into canvas',
|
|||||||
).toBeVisible();
|
).toBeVisible();
|
||||||
await expect(
|
await expect(
|
||||||
page.locator('.affine-embed-linked-doc-content-title')
|
page.locator('.affine-embed-linked-doc-content-title')
|
||||||
).toContainText('Getting Started');
|
).toContainText(docTitle);
|
||||||
|
|
||||||
// focus on the note block
|
// focus on the note block
|
||||||
await page.waitForTimeout(500);
|
await page.waitForTimeout(500);
|
||||||
|
|||||||
Reference in New Issue
Block a user