refactor(editor): do not create a tag column by default anymore (#9789)

close: BS-2423
This commit is contained in:
zzj3720
2025-01-20 06:59:09 +00:00
parent dce71f8e6e
commit 2e18ae59e3
5 changed files with 23 additions and 51 deletions

View File

@@ -71,22 +71,28 @@ export async function verifyCellContents(
}
}
export async function selectColumnType(page: Page, columnType: string) {
export async function selectColumnType(
page: Page,
columnType: string,
nth: number = 1
) {
const typeMenu = page.locator('affine-menu').getByText('Type');
await page.waitForTimeout(100);
await typeMenu.hover();
await page.waitForTimeout(100);
await page.keyboard.type(columnType);
await page.waitForTimeout(100);
await page.keyboard.press('ArrowDown');
for (let i = 0; i < nth; i++) {
await page.keyboard.press('ArrowDown');
}
await page.waitForTimeout(100);
await page.keyboard.press('Enter');
await page.waitForTimeout(100);
}
export async function addColumn(page: Page, type: string) {
export async function addColumn(page: Page, type: string, nth: number = 1) {
await clickAddColumnButton(page);
await selectColumnType(page, type);
await selectColumnType(page, type, nth);
}
export async function clickAddColumnButton(page: Page) {