fix: block hub might not work (#3199)
This commit is contained in:
1 parent
c066224a95
commit
5dda7d83da
3 files changed
+37
-9
No files matched your search
@@ -0,0 +1,12 @@
|
||||
import type { Page } from '@playwright/test';
|
||||
import { expect } from '@playwright/test';
|
||||
|
||||
export async function checkBlockHub(page: Page) {
|
||||
const box = await page.locator('affine-block-hub').boundingBox();
|
||||
if (!box) throw new Error('block-hub not found');
|
||||
await page.getByTestId('block-hub').click();
|
||||
await page.waitForTimeout(500);
|
||||
const box2 = await page.locator('affine-block-hub').boundingBox();
|
||||
if (!box2) throw new Error('block-hub not found');
|
||||
expect(box2.height).toBeGreaterThan(box.height);
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import { test } from '@affine-test/kit/playwright';
|
||||
|
||||
import { checkBlockHub } from '../../libs/editor';
|
||||
import { openHomePage } from '../../libs/load-page';
|
||||
import { newPage, waitEditorLoad } from '../../libs/page-logic';
|
||||
|
||||
test('block-hub should work', async ({ page }) => {
|
||||
await openHomePage(page);
|
||||
await waitEditorLoad(page);
|
||||
await checkBlockHub(page);
|
||||
await newPage(page);
|
||||
await page.waitForTimeout(500);
|
||||
await checkBlockHub(page);
|
||||
});
|
||||
Reference in new issue
Block a user