fix: note should hide collapse button in presentation mode (#11292)

Fixes [BS-1003](https://linear.app/affine-design/issue/BS-1003/ppt-演示状态下-note-会显示折叠箭头)
This commit is contained in:
doouding
2025-03-31 05:24:29 +00:00
committed by xiaoxin
parent 24c382d3aa
commit 18cb4199fa
2 changed files with 31 additions and 2 deletions

View File

@@ -9,8 +9,11 @@ import {
edgelessCommonSetup,
enterPresentationMode,
locatorPresentationToolbarButton,
resizeElementByHandle,
selectNoteInEdgeless,
setEdgelessTool,
Shape,
switchEditorMode,
toggleFramePanel,
} from '../utils/actions/edgeless.js';
import {
@@ -19,7 +22,11 @@ import {
pressEscape,
selectAllBlocksByKeyboard,
} from '../utils/actions/keyboard.js';
import { waitNextFrame } from '../utils/actions/misc.js';
import {
enterPlaygroundRoom,
initEmptyEdgelessState,
waitNextFrame,
} from '../utils/actions/misc.js';
import { test } from '../utils/playwright.js';
test.describe('presentation', () => {
@@ -246,4 +253,22 @@ test.describe('presentation', () => {
await expect(frameItems.nth(6)).toHaveText('Frame 3');
await expect(frameItems.nth(7)).toHaveText('Frame 4');
});
test('note should hide the collapse button when enter presentation mode', async ({
page,
}) => {
await enterPlaygroundRoom(page);
const { noteId } = await initEmptyEdgelessState(page);
await switchEditorMode(page);
await selectNoteInEdgeless(page, noteId);
await resizeElementByHandle(page, { x: 0, y: 70 }, 'bottom-right');
await createFrame(page, [100, 100], [100, 200]);
await enterPresentationMode(page);
const collapseButton = page.getByTestId('edgeless-note-collapse-button');
await expect(collapseButton).not.toBeVisible();
});
});