refactor(editor): edgeless element toolbar with new pattern (#10511)

This commit is contained in:
fundon
2025-03-18 15:36:25 +00:00
parent 3939cc1c52
commit cb37d25d7b
31 changed files with 838 additions and 367 deletions

View File

@@ -8,6 +8,7 @@ import {
dragBetweenIndices,
enterPlaygroundRoom,
focusRichText,
focusRichTextEnd,
focusTitle,
getBoundingBox,
getEditorHostLocator,
@@ -330,13 +331,22 @@ test('should format quick bar be able to link text', async ({
const linkPopoverInput = page.locator('.affine-link-popover-input');
await expect(linkPopoverInput).toBeVisible();
await type(page, 'https://www.example.com');
const url = 'https://www.example.com';
await type(page, url);
await pressEnter(page);
expect(await getPageSnapshot(page, true)).toMatchSnapshot(
`${testInfo.title}_init.json`
);
const linkLocator = page.locator('affine-link a');
await expect(linkLocator).toHaveAttribute('href', url);
await focusRichTextEnd(page);
await dragBetweenIndices(page, [1, 3], [1, 0]);
// The link button should be active after click
await expect(linkBtn).toHaveAttribute('active', '');
await linkBtn.click();