mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
fix: correct router logic (#2342)
This commit is contained in:
@@ -36,9 +36,6 @@ test('public single page', async ({ page, browser }) => {
|
||||
);
|
||||
await page.getByTestId('confirm-enable-cloud-button').click();
|
||||
await promise;
|
||||
const newPage2Url = page.url().split('/');
|
||||
newPage2Url[newPage2Url.length - 1] = page2Id as string;
|
||||
await page.goto(newPage2Url.join('/'));
|
||||
await page.waitForSelector('v-line');
|
||||
const currentTitle = await page
|
||||
.locator('[data-block-is-title="true"]')
|
||||
|
||||
@@ -46,9 +46,10 @@ test('should enable affine workspace successfully', async ({ page }) => {
|
||||
await page.locator('[data-block-is-title="true"]').type('Hello, world!', {
|
||||
delay: 50,
|
||||
});
|
||||
await page.waitForTimeout(1000);
|
||||
await assertCurrentWorkspaceFlavour('affine', page);
|
||||
await openWorkspaceListModal(page);
|
||||
await page.getByTestId('workspace-list-modal-sign-out').click();
|
||||
await page.waitForTimeout(1000);
|
||||
await waitMarkdownImported(page);
|
||||
await assertCurrentWorkspaceFlavour('local', page);
|
||||
});
|
||||
|
||||
@@ -9,9 +9,7 @@ test('Open last workspace when back to affine', async ({ page }) => {
|
||||
await openHomePage(page);
|
||||
await waitMarkdownImported(page);
|
||||
await createWorkspace({ name: 'New Workspace 2' }, page);
|
||||
// FIXME: can not get when the new workspace is surely created, hack a timeout to wait
|
||||
// waiting for page loading end
|
||||
await page.waitForTimeout(3000);
|
||||
await waitMarkdownImported(page);
|
||||
// show workspace list
|
||||
await page.getByTestId('workspace-name').click();
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ import { expect } from '@playwright/test';
|
||||
|
||||
import { openHomePage, webUrl } from '../libs/load-page';
|
||||
import { waitMarkdownImported } from '../libs/page-logic';
|
||||
import { clickSideBarAllPageButton } from '../libs/sidebar';
|
||||
|
||||
test('goto not found page', async ({ page }) => {
|
||||
await openHomePage(page);
|
||||
@@ -17,9 +16,8 @@ test('goto not found page', async ({ page }) => {
|
||||
test('goto not found workspace', async ({ page }) => {
|
||||
await openHomePage(page);
|
||||
await waitMarkdownImported(page);
|
||||
await clickSideBarAllPageButton(page);
|
||||
const currentUrl = page.url();
|
||||
await page.goto(new URL('/workspace/invalid/all', webUrl).toString());
|
||||
await clickSideBarAllPageButton(page);
|
||||
await page.waitForSelector('v-line');
|
||||
expect(page.url()).toEqual(currentUrl);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user