fix(editor): overflow of embed github card in edgeless note (#10442)
This PR fixes the overflow of the `embed-github-card` inside edgeless notes. https://github.com/user-attachments/assets/21775d0f-e4c8-4fcc-86d8-aafb27033358
This commit is contained in:
@@ -4,19 +4,20 @@ import {
|
||||
locateEditorContainer,
|
||||
locateElementToolbar,
|
||||
} from '@affine-test/kit/utils/editor';
|
||||
import { pressEnter } from '@affine-test/kit/utils/keyboard';
|
||||
import { openHomePage } from '@affine-test/kit/utils/load-page';
|
||||
import {
|
||||
clickNewPageButton,
|
||||
type,
|
||||
waitForEditorLoad,
|
||||
} from '@affine-test/kit/utils/page-logic';
|
||||
import { isContainedInBoundingBox } from '@affine-test/kit/utils/utils';
|
||||
import { expect } from '@playwright/test';
|
||||
|
||||
const title = 'Edgeless Note Header Test';
|
||||
|
||||
test.beforeEach(async ({ page }) => {
|
||||
await openHomePage(page);
|
||||
await waitForEditorLoad(page);
|
||||
await clickNewPageButton(page, title);
|
||||
await clickNewPageButton(page);
|
||||
await clickEdgelessModeButton(page);
|
||||
const container = locateEditorContainer(page);
|
||||
await container.click();
|
||||
@@ -40,3 +41,20 @@ test('should close embed editing modal when editor switching to page mode by sho
|
||||
await waitForEditorLoad(page);
|
||||
expect(editingModal).toBeHidden();
|
||||
});
|
||||
|
||||
test('embed card should not overflow the edgeless note', async ({ page }) => {
|
||||
const note = page.locator('affine-edgeless-note');
|
||||
await note.dblclick();
|
||||
await type(page, '/github');
|
||||
await pressEnter(page);
|
||||
await page
|
||||
.locator('.embed-card-modal-input')
|
||||
.fill('https://github.com/toeverything/AFFiNE/pull/10442');
|
||||
await pressEnter(page);
|
||||
|
||||
const embedCard = page.locator('affine-embed-github-block');
|
||||
await embedCard
|
||||
.locator('.affine-embed-github-block:not(.loading)')
|
||||
.waitFor({ state: 'visible' });
|
||||
expect(await isContainedInBoundingBox(note, embedCard, true)).toBe(true);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user