Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

test: update visit 404 page test case

JimmFly66d2033cdab0
diff --git a/packages/app/src/components/404/index.tsx b/packages/app/src/components/404/index.tsx
index 0a06467afa..ffba2a08d2 100644
--- a/packages/app/src/components/404/index.tsx
+++ b/packages/app/src/components/404/index.tsx
@@ -7,7 +7,7 @@ export const NotfoundPage = () => {
const router = useRouter();
return (
<PageContainer>
- <NotFoundTitle>
+ <NotFoundTitle data-testid="notFound">
{t('404 - Page Not Found')}
<p>
<Button
diff --git a/tests/exception-page.spec.ts b/tests/exception-page.spec.ts
index dfc1a6d7b2..b7746fe861 100644
--- a/tests/exception-page.spec.ts
+++ b/tests/exception-page.spec.ts
@@ -8,8 +8,7 @@ loadPage();
test.describe('exception page', () => {
test('visit 404 page', async ({ page }) => {
await page.goto('http://localhost:8080/404');
- await page.waitForTimeout(1000);
- const notFoundTip = page.getByText('404 - Page Not Found');
- expect(await notFoundTip.isVisible()).toBe(true);
+ const notFoundTip = page.locator('[data-testid=notFound]');
+ await expect(notFoundTip).toBeVisible();
});
});