mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-09-22 19:53:48 +08:00
test(core): add missing await for expect (#11900)
This commit is contained in:
@@ -36,7 +36,7 @@ test('should close embed editing modal when editor switching to page mode by sho
|
||||
|
||||
await page.keyboard.press('Alt+s');
|
||||
await waitForEditorLoad(page);
|
||||
expect(editingModal).toBeHidden();
|
||||
await expect(editingModal).toBeHidden();
|
||||
});
|
||||
|
||||
test('embed card should not overflow the edgeless note', async ({ page }) => {
|
||||
|
||||
@@ -53,6 +53,6 @@ test('should not show hidden note in embed view page mode', async ({
|
||||
|
||||
// check the content
|
||||
const embedLink = page.locator('affine-embed-synced-doc-block');
|
||||
expect(embedLink.getByText(/visible content/)).toBeVisible();
|
||||
expect(embedLink.getByText(/hidden content/)).toBeHidden();
|
||||
await expect(embedLink.getByText(/visible content/)).toBeVisible();
|
||||
await expect(embedLink.getByText(/hidden content/)).toBeHidden();
|
||||
});
|
||||
|
||||
@@ -193,15 +193,15 @@ test.describe('TOC display', () => {
|
||||
const toc = await openTocPanel(page);
|
||||
const sortingButton = locateSortingButton(toc);
|
||||
await expect(sortingButton).not.toHaveClass(/active/);
|
||||
expect(toc.locator('[data-sortable="false"]')).toHaveCount(1);
|
||||
await expect(toc.locator('[data-sortable="false"]')).toHaveCount(1);
|
||||
|
||||
await clickEdgelessModeButton(page);
|
||||
await expect(sortingButton).toHaveClass(/active/);
|
||||
expect(toc.locator('[data-sortable="true"]')).toHaveCount(1);
|
||||
await expect(toc.locator('[data-sortable="true"]')).toHaveCount(1);
|
||||
|
||||
await sortingButton.click();
|
||||
await expect(sortingButton).not.toHaveClass(/active/);
|
||||
expect(toc.locator('[data-sortable="false"]')).toHaveCount(1);
|
||||
await expect(toc.locator('[data-sortable="false"]')).toHaveCount(1);
|
||||
});
|
||||
|
||||
test('should notify user when there are some page only notes and sorting is disabled', async ({
|
||||
|
||||
@@ -176,7 +176,7 @@ test('should hide edgeless-only note headings', async ({ page }) => {
|
||||
.getByTestId('outline-block-preview-h1')
|
||||
.locator('span');
|
||||
await h1InPanel.waitFor({ state: 'visible' });
|
||||
expect(h1InPanel).toContainText(['Heading 1']);
|
||||
await expect(h1InPanel).toContainText(['Heading 1']);
|
||||
});
|
||||
|
||||
test('outline viewer should be useable in doc peek preview', async ({
|
||||
|
||||
Reference in New Issue
Block a user