mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-12 20:38:52 +00:00
chore: standardize tsconfig (#9568)
This commit is contained in:
48
tests/kit/src/utils/workspace.ts
Normal file
48
tests/kit/src/utils/workspace.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import type { Page } from '@playwright/test';
|
||||
import { expect } from '@playwright/test';
|
||||
|
||||
import { waitForEditorLoad } from './page-logic';
|
||||
|
||||
interface CreateWorkspaceParams {
|
||||
name: string;
|
||||
}
|
||||
|
||||
export async function openWorkspaceListModal(page: Page) {
|
||||
await page.getByTestId('app-sidebar').getByTestId('workspace-name').click({
|
||||
delay: 50,
|
||||
});
|
||||
}
|
||||
|
||||
export async function createLocalWorkspace(
|
||||
params: CreateWorkspaceParams,
|
||||
page: Page
|
||||
) {
|
||||
await openWorkspaceListModal(page);
|
||||
|
||||
// open create workspace modal
|
||||
await page.getByTestId('new-workspace').click();
|
||||
|
||||
// const isDesktop: boolean = await page.evaluate(() => {
|
||||
// return !!window.appInfo?.electron;
|
||||
// }, []);
|
||||
|
||||
// input workspace name
|
||||
await page.getByPlaceholder('Set a Workspace name').click();
|
||||
await page.getByPlaceholder('Set a Workspace name').fill(params.name);
|
||||
|
||||
// click create button
|
||||
await page.getByTestId('create-workspace-create-button').click({
|
||||
delay: 500,
|
||||
});
|
||||
|
||||
await expect(
|
||||
page.getByTestId('create-workspace-create-button')
|
||||
).not.toBeAttached();
|
||||
await waitForEditorLoad(page);
|
||||
|
||||
await expect(page.getByTestId('workspace-name')).toHaveText(params.name);
|
||||
|
||||
// if (isDesktop) {
|
||||
// await page.getByTestId('create-workspace-continue-button').click();
|
||||
// }
|
||||
}
|
||||
Reference in New Issue
Block a user