mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 12:28:42 +00:00
34 lines
1.0 KiB
TypeScript
34 lines
1.0 KiB
TypeScript
import { expect } from '@playwright/test';
|
|
|
|
import {
|
|
dragBetweenCoords,
|
|
enterPlaygroundRoom,
|
|
initImageState,
|
|
} from '../utils/actions/index.js';
|
|
import { assertRichImage } from '../utils/asserts.js';
|
|
import { test } from '../utils/playwright.js';
|
|
|
|
test('select image should not show format bar', async ({ page }) => {
|
|
await enterPlaygroundRoom(page);
|
|
await initImageState(page);
|
|
await assertRichImage(page, 1);
|
|
|
|
const image = page.locator('affine-image');
|
|
const rect = await image.boundingBox();
|
|
if (!rect) {
|
|
throw new Error('image not found');
|
|
}
|
|
await dragBetweenCoords(
|
|
page,
|
|
{ x: rect.x - 20, y: rect.y + 20 },
|
|
{ x: rect.x + 20, y: rect.y + 40 }
|
|
);
|
|
const rects = page.locator('affine-block-selection').locator('visible=true');
|
|
await expect(rects).toHaveCount(1);
|
|
const formatQuickBar = page.locator(`.format-quick-bar`);
|
|
await expect(formatQuickBar).not.toBeVisible();
|
|
await page.mouse.wheel(0, rect.y + rect.height);
|
|
await expect(formatQuickBar).not.toBeVisible();
|
|
await page.mouse.click(0, 0);
|
|
});
|