mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
fix(editor): get block props (#11807)
Closes: [BS-3184](https://linear.app/affine-design/issue/BS-3184/duplicate-图片,一直在loading)
This commit is contained in:
@@ -370,3 +370,35 @@ test('should clear selection when switching doc mode', async ({ page }) => {
|
||||
|
||||
await expect(toolbar).toBeHidden();
|
||||
});
|
||||
|
||||
test.describe('Toolbar More Actions', () => {
|
||||
test('should duplicate block', async ({ page }) => {
|
||||
await page.keyboard.press('Enter');
|
||||
|
||||
await importImage(page, 'large-image.png');
|
||||
const images = page.locator('affine-page-image');
|
||||
|
||||
const firstImage = images.first();
|
||||
const firstImageUrl = await firstImage.locator('img').getAttribute('src');
|
||||
|
||||
await firstImage.hover();
|
||||
|
||||
const toolbar = locateToolbar(page);
|
||||
const moreMenu = toolbar.getByLabel('More menu');
|
||||
await moreMenu.click();
|
||||
|
||||
const duplicateButton = toolbar.getByTestId('duplicate');
|
||||
await duplicateButton.click();
|
||||
|
||||
await expect(images).toHaveCount(2);
|
||||
|
||||
const secondImage = images.nth(1);
|
||||
const secondImageUrl = await secondImage.locator('img').getAttribute('src');
|
||||
|
||||
expect(firstImageUrl).not.toBeNull();
|
||||
expect(firstImageUrl!.startsWith('blob:')).toBe(true);
|
||||
|
||||
expect(secondImageUrl).not.toBeNull();
|
||||
expect(secondImageUrl!.startsWith('blob:')).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user