mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 04:18:54 +00:00
fix(editor): banner of blookmark not shown in edgeless (#11796)
Close [BS-2651](https://app.graphite.dev/github/pr/toeverything/AFFiNE/11797/chore(editor)-add-feature-flag-to-embed-doc-with-alias) ### What Changes: - Fixed banner of edgeless embed bookmark is not shown - Add fallback bookmark creation with embed creation modal when there is not a `QuickSearchProvider` in blocksuite playground - Add tests for embed blookmark and embed github block in edgeless
This commit is contained in:
@@ -6,6 +6,7 @@ import { expect } from '@playwright/test';
|
||||
|
||||
import {
|
||||
activeNoteInEdgeless,
|
||||
clickView,
|
||||
copyByKeyboard,
|
||||
dragBlockToPoint,
|
||||
enterPlaygroundRoom,
|
||||
@@ -15,6 +16,7 @@ import {
|
||||
initEmptyEdgelessState,
|
||||
initEmptyParagraphState,
|
||||
pasteByKeyboard,
|
||||
pasteContent,
|
||||
pressArrowDown,
|
||||
pressArrowRight,
|
||||
pressArrowUp,
|
||||
@@ -357,6 +359,21 @@ test('bookmark can be dragged from note to surface top level block', async ({
|
||||
await assertParentBlockFlavour(page, '4', 'affine:surface');
|
||||
});
|
||||
|
||||
test('bookmark card should show banner in edgeless mode', async ({ page }) => {
|
||||
await enterPlaygroundRoom(page);
|
||||
await initEmptyEdgelessState(page);
|
||||
await switchEditorMode(page);
|
||||
|
||||
const url = 'https://github.com/toeverything/AFFiNE/pull/11796';
|
||||
|
||||
await page.locator('edgeless-link-tool-button').click();
|
||||
await page.locator('.embed-card-modal-input').fill(url);
|
||||
await pressEnter(page);
|
||||
|
||||
const banner = page.locator('.affine-bookmark-banner');
|
||||
await expect(banner).toBeVisible();
|
||||
});
|
||||
|
||||
test.describe('embed youtube card', () => {
|
||||
test(scoped`create youtube card by slash menu`, async ({ page }) => {
|
||||
expectConsoleMessage(page, /Unrecognized feature/, 'warning');
|
||||
@@ -464,3 +481,22 @@ test.describe('embed figma card', () => {
|
||||
expect(ignoreSnapshotId(snapshot2)).toMatchSnapshot('embed-figma.json');
|
||||
});
|
||||
});
|
||||
|
||||
test.describe('embed github card', () => {
|
||||
test('github embed card should show banner in edgeless mode', async ({
|
||||
page,
|
||||
}) => {
|
||||
await enterPlaygroundRoom(page);
|
||||
await initEmptyEdgelessState(page);
|
||||
await switchEditorMode(page);
|
||||
await clickView(page, [0, 0]);
|
||||
const url = 'https://github.com/toeverything/AFFiNE/pull/11796';
|
||||
|
||||
await pasteContent(page, {
|
||||
'text/plain': url,
|
||||
});
|
||||
|
||||
const banner = page.locator('.affine-embed-github-banner');
|
||||
await expect(banner).toBeVisible();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user