2023-04-25 06:12:48 +03:00
|
|
|
import { test } from '@affine-test/kit/playwright';
|
2023-04-22 04:44:29 +03:00
|
|
|
import { expect } from '@playwright/test';
|
|
|
|
|
|
|
|
import { openHomePage, webUrl } from '../libs/load-page';
|
2023-06-07 12:31:54 +03:00
|
|
|
import { waitEditorLoad } from '../libs/page-logic';
|
2023-04-22 04:44:29 +03:00
|
|
|
|
|
|
|
test('goto not found page', async ({ page }) => {
|
|
|
|
await openHomePage(page);
|
2023-06-07 12:31:54 +03:00
|
|
|
await waitEditorLoad(page);
|
2023-04-22 04:44:29 +03:00
|
|
|
const currentUrl = page.url();
|
2023-07-07 17:15:27 +03:00
|
|
|
const invalidUrl = currentUrl.replace('hello-world', 'invalid');
|
2023-04-22 04:44:29 +03:00
|
|
|
await page.goto(invalidUrl);
|
2023-07-07 17:15:27 +03:00
|
|
|
await expect(page.getByTestId('notFound')).toBeVisible();
|
2023-04-22 04:44:29 +03:00
|
|
|
});
|
|
|
|
|
|
|
|
test('goto not found workspace', async ({ page }) => {
|
|
|
|
await openHomePage(page);
|
2023-06-07 12:31:54 +03:00
|
|
|
await waitEditorLoad(page);
|
2023-04-22 04:44:29 +03:00
|
|
|
const currentUrl = page.url();
|
|
|
|
await page.goto(new URL('/workspace/invalid/all', webUrl).toString());
|
2023-06-07 12:31:54 +03:00
|
|
|
await waitEditorLoad(page);
|
2023-04-22 04:44:29 +03:00
|
|
|
expect(page.url()).toEqual(currentUrl);
|
|
|
|
});
|