mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-30 00:29:46 +08:00
fix(editor): typecheck for tests and playground (#9897)
This commit is contained in:
@@ -1,9 +1,8 @@
|
||||
import type {
|
||||
RichTextCell,
|
||||
RichTextCellEditing,
|
||||
} from '@blocks/database-block/properties/rich-text/cell-renderer.js';
|
||||
import { press } from '@inline/__tests__/utils.js';
|
||||
import { ZERO_WIDTH_SPACE } from '@inline/consts.js';
|
||||
} from '@blocksuite/affine-block-database';
|
||||
import { ZERO_WIDTH_SPACE } from '@blocksuite/inline';
|
||||
import { expect, type Locator, type Page } from '@playwright/test';
|
||||
|
||||
import {
|
||||
@@ -18,6 +17,11 @@ import {
|
||||
waitNextFrame,
|
||||
} from '../utils/actions/misc.js';
|
||||
|
||||
export async function press(page: Page, content: string) {
|
||||
await page.keyboard.press(content, { delay: 50 });
|
||||
await page.waitForTimeout(50);
|
||||
}
|
||||
|
||||
export async function initDatabaseColumn(page: Page, title = '') {
|
||||
const editor = getEditorLocator(page);
|
||||
await editor.locator('affine-data-view-table-group').first().hover();
|
||||
@@ -265,7 +269,7 @@ export async function assertDatabaseCellLink(
|
||||
'affine-database-link-cell-editing'
|
||||
);
|
||||
if (!richText) throw new Error('Missing database rich text cell');
|
||||
return richText.inlineEditor.yText.toString();
|
||||
return richText.inlineEditor!.yText.toString();
|
||||
},
|
||||
{ rowIndex, columnIndex }
|
||||
);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { press } from '@inline/__tests__/utils.js';
|
||||
import { expect, type Page } from '@playwright/test';
|
||||
|
||||
import { type } from '../utils/actions/index.js';
|
||||
@@ -9,7 +8,12 @@ import {
|
||||
waitNextFrame,
|
||||
} from '../utils/actions/misc.js';
|
||||
import { test } from '../utils/playwright.js';
|
||||
import { changeColumnType, moveToCenterOf, pressKey } from './actions.js';
|
||||
import {
|
||||
changeColumnType,
|
||||
moveToCenterOf,
|
||||
press,
|
||||
pressKey,
|
||||
} from './actions.js';
|
||||
|
||||
const addRow = async (page: Page, count: number = 1) => {
|
||||
await waitNextFrame(page);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { press } from '@inline/__tests__/utils.js';
|
||||
import { expect } from '@playwright/test';
|
||||
|
||||
import {
|
||||
@@ -7,6 +6,7 @@ import {
|
||||
initEmptyDatabaseState,
|
||||
} from '../utils/actions/misc.js';
|
||||
import { test } from '../utils/playwright.js';
|
||||
import { press } from './actions.js';
|
||||
|
||||
test.describe('title', () => {
|
||||
test('should able to link doc by press @', async ({ page }) => {
|
||||
|
||||
Reference in New Issue
Block a user