chore: [app-router-migration 14] migrate not-found page (#13032)

* chore: migrate not-found page

* migrate page, replace ssgInit

* fix flaky test

* fix

* fix

* fix
This commit is contained in:
DmytroHryshyn authored and GitHub committed 2024-01-12 18:21:35 -03:00
1 parent 0bdc45a1a5
commit abd90f6af8
9 files changed
+41 -9

No files matched your search

@@ -3,7 +3,7 @@ import { expect } from "@playwright/test";
import type { Fixtures } from "@calcom/web/playwright/lib/fixtures";
import { test } from "@calcom/web/playwright/lib/fixtures";
import { NotFoundPageText, gotoRoutingLink } from "@calcom/web/playwright/lib/testUtils";
import { NotFoundPageTextAppDir, gotoRoutingLink } from "@calcom/web/playwright/lib/testUtils";
import {
addForm,
@@ -36,7 +36,7 @@ test.describe("Routing Forms", () => {
await page.goto(`apps/routing-forms/route-builder/${formId}`);
await disableForm(page);
await gotoRoutingLink({ page, formId });
await expect(page.locator(`text=${NotFoundPageText}`)).toBeVisible();
await expect(page.locator(`text=${NotFoundPageTextAppDir}`)).toBeVisible();
});
test("should be able to edit the form", async ({ page }) => {
@@ -17,6 +17,15 @@ class ErrorBoundary extends React.Component<
}
render() {
// do not intercept next-not-found error, allow displaying not-found.tsx page when notFound() is thrown on server side
if (
this.state.error !== null &&
"digest" in this.state.error &&
this.state.error.digest === "NEXT_NOT_FOUND"
) {
return this.props.children;
}
if (this.state.errorInfo) {
// Error path
return (