mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-01 01:29:31 +08:00
test: make workspace list tests stable
This commit is contained in:
@@ -18,7 +18,5 @@ export async function createWorkspace(
|
|||||||
await page.getByPlaceholder('Set a Workspace name').fill(params.name);
|
await page.getByPlaceholder('Set a Workspace name').fill(params.name);
|
||||||
|
|
||||||
// click create button
|
// click create button
|
||||||
await page.getByRole('button', { name: 'Create' }).click();
|
return page.getByRole('button', { name: 'Create' }).click();
|
||||||
|
|
||||||
return page.waitForTimeout(300);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,13 +16,17 @@ test.describe('Local first workspace list', () => {
|
|||||||
).not.toBeNull();
|
).not.toBeNull();
|
||||||
});
|
});
|
||||||
|
|
||||||
test.skip('create one workspace in the workspace list', async ({ page }) => {
|
test('create one workspace in the workspace list', async ({ page }) => {
|
||||||
const newWorkspaceNameStr = 'New Workspace';
|
const newWorkspaceNameStr = 'New Workspace';
|
||||||
await createWorkspace({ name: newWorkspaceNameStr }, page);
|
await createWorkspace({ name: newWorkspaceNameStr }, page);
|
||||||
|
|
||||||
// check new workspace name
|
// check new workspace name
|
||||||
const newWorkspaceName = page.getByTestId('workspace-name');
|
const newWorkspaceName = page.getByTestId('workspace-name');
|
||||||
expect(await newWorkspaceName.textContent()).toBe(newWorkspaceNameStr);
|
await newWorkspaceName.click();
|
||||||
|
|
||||||
|
//check workspace list length
|
||||||
|
const workspaceCards = await page.$$('data-testid=workspace-card');
|
||||||
|
expect(workspaceCards.length).toBe(2);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('create multi workspace in the workspace list', async ({ page }) => {
|
test('create multi workspace in the workspace list', async ({ page }) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user