diff --git a/packages/affine/block-surface/src/element-model/mindmap.ts b/packages/affine/block-surface/src/element-model/mindmap.ts index 5d3380ccd3e6..13e92a9fc3a0 100644 --- a/packages/affine/block-surface/src/element-model/mindmap.ts +++ b/packages/affine/block-surface/src/element-model/mindmap.ts @@ -518,7 +518,7 @@ export class MindmapElementModel extends GfxGroupLikeElementModel { + await edgelessCommonSetup(page); + await zoomResetByKeyboard(page); + + await page.keyboard.press('m'); + await clickView(page, [0, 0]); + await autoFit(page); + + await selectAllByKeyboard(page); + const mindmapBound = await getSelectedBound(page); + + await pressBackspace(page); + + await selectAllByKeyboard(page); + expect(await getSelectedBoundCount(page)).toBe(0); + + await undoByKeyboard(page); + + await selectAllByKeyboard(page); + await assertSelectedBound(page, mindmapBound); +}); diff --git a/tests/utils/actions/edgeless.ts b/tests/utils/actions/edgeless.ts index 6c6a479284cf..30679e9fdcbf 100644 --- a/tests/utils/actions/edgeless.ts +++ b/tests/utils/actions/edgeless.ts @@ -22,6 +22,7 @@ import { enterPlaygroundRoom, getEditorLocator, initEmptyEdgelessState, + resetHistory, waitNextFrame, } from './misc.js'; @@ -1707,6 +1708,7 @@ export async function edgelessCommonSetup(page: Page) { await initEmptyEdgelessState(page); await switchEditorMode(page); await deleteAll(page); + await resetHistory(page); } export async function createFrame(