mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-19 23:37:15 +08:00
refactor(editor): image toolbar config extension (#11329)
Closes: [BS-2378](https://linear.app/affine-design/issue/BS-2378/image-toolbar-迁移)
This commit is contained in:
@@ -1132,14 +1132,14 @@ test('should blur rich-text first on starting block selection', async ({
|
||||
await expect(page.locator('*:focus')).toHaveCount(0);
|
||||
});
|
||||
|
||||
test('should not show option menu of image on block selection', async ({
|
||||
page,
|
||||
}) => {
|
||||
test('should show toolbar of image on block selection', async ({ page }) => {
|
||||
await enterPlaygroundRoom(page);
|
||||
await initImageState(page);
|
||||
await activeEmbed(page);
|
||||
|
||||
await expect(page.locator('.affine-image-toolbar-container')).toHaveCount(1);
|
||||
const toolbar = page.locator('affine-toolbar-widget editor-toolbar');
|
||||
|
||||
await expect(toolbar).toBeHidden();
|
||||
|
||||
await pressEnter(page);
|
||||
|
||||
@@ -1162,7 +1162,7 @@ test('should not show option menu of image on block selection', async ({
|
||||
|
||||
await page.waitForTimeout(50);
|
||||
|
||||
await expect(page.locator('.affine-image-toolbar-container')).toHaveCount(0);
|
||||
await expect(toolbar).toBeVisible();
|
||||
await expect(
|
||||
page.locator('affine-block-selection').locator('visible=true')
|
||||
).toHaveCount(1);
|
||||
|
||||
@@ -1338,14 +1338,16 @@ test('should keep native range selection when scrolling forward with the scroll
|
||||
assertClipItems(page, 'text/plain', '123456789');
|
||||
});
|
||||
|
||||
test('should not show option menu of image on native selection', async ({
|
||||
test('should not show toolbar of image on native selection', async ({
|
||||
page,
|
||||
}) => {
|
||||
await enterPlaygroundRoom(page);
|
||||
await initImageState(page);
|
||||
await activeEmbed(page);
|
||||
|
||||
await expect(page.locator('.affine-image-toolbar-container')).toHaveCount(1);
|
||||
const toolbar = page.locator('affine-toolbar-widget editor-toolbar');
|
||||
|
||||
await expect(toolbar).toBeVisible();
|
||||
|
||||
await pressEscape(page);
|
||||
await pressEnter(page);
|
||||
@@ -1381,7 +1383,7 @@ test('should not show option menu of image on native selection', async ({
|
||||
await copyByKeyboard(page);
|
||||
assertClipItems(page, 'text/plain', '123');
|
||||
|
||||
await expect(page.locator('.affine-image-toolbar-container')).toHaveCount(0);
|
||||
await expect(toolbar).toBeHidden();
|
||||
});
|
||||
|
||||
test('should select with shift-click', async ({ page }) => {
|
||||
|
||||
Reference in New Issue
Block a user