test(editor): move blocksuite test to tests folder (#10917)

This commit is contained in:
Saul-Mirone
2025-03-17 06:40:25 +00:00
parent 0f83566504
commit d5a5df5e49
352 changed files with 47 additions and 44 deletions

View File

@@ -0,0 +1,43 @@
import {
cutByKeyboard,
dragOverTitle,
enterPlaygroundRoom,
focusRichText,
focusTitle,
initEmptyParagraphState,
pasteByKeyboard,
pressEnter,
type,
} from '../utils/actions/index.js';
import { assertRichTexts, assertTitle } from '../utils/asserts.js';
import { test } from '../utils/playwright.js';
test('should cut in title works', async ({ page }) => {
await enterPlaygroundRoom(page);
await initEmptyParagraphState(page);
await focusTitle(page);
await type(page, 'hello');
await assertTitle(page, 'hello');
await dragOverTitle(page);
await cutByKeyboard(page);
await assertTitle(page, '');
await focusRichText(page);
await pasteByKeyboard(page);
await assertRichTexts(page, ['hello']);
});
test('enter in title should move cursor in new paragraph block', async ({
page,
}) => {
await enterPlaygroundRoom(page);
await initEmptyParagraphState(page);
await focusTitle(page);
await type(page, 'hello');
await assertTitle(page, 'hello');
await pressEnter(page);
await type(page, 'world');
await assertRichTexts(page, ['world', '']);
});