mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 20:38:52 +00:00
fix(editor): can not move carte at the end of inline element (#11558)
Close [BS-2922](https://linear.app/affine-design/issue/BS-2922/【移动端-ios】文档添加linked-page后,无法删除)
This commit is contained in:
@@ -5,6 +5,11 @@ import { expect, type Locator, type Page } from '@playwright/test';
|
||||
declare type _GLOBAL_ = typeof BlocksuiteEffects;
|
||||
|
||||
const EDGELESS_TOOLBAR_WIDGET = 'edgeless-toolbar-widget';
|
||||
export const ZERO_WIDTH_SPACE = '\u200C';
|
||||
|
||||
export function inlineEditorInnerTextToString(innerText: string): string {
|
||||
return innerText.replace(ZERO_WIDTH_SPACE, '').trim();
|
||||
}
|
||||
|
||||
export function locateModeSwitchButton(
|
||||
page: Page,
|
||||
@@ -62,6 +67,13 @@ export async function focusDocTitle(page: Page, editorIndex = 0) {
|
||||
await locateDocTitle(page, editorIndex).locator('.inline-editor').focus();
|
||||
}
|
||||
|
||||
export async function assertTitle(page: Page, text: string) {
|
||||
const title = locateDocTitle(page);
|
||||
const inlineEditor = title.locator('.doc-title-container').first();
|
||||
const vText = inlineEditorInnerTextToString(await inlineEditor.innerText());
|
||||
expect(vText).toBe(text);
|
||||
}
|
||||
|
||||
export function locateToolbar(page: Page, editorIndex = 0) {
|
||||
return locateEditorContainer(page, editorIndex).locator(
|
||||
'affine-toolbar-widget editor-toolbar'
|
||||
|
||||
Reference in New Issue
Block a user