diff --git a/.changeset/rare-bees-beg.md b/.changeset/rare-bees-beg.md new file mode 100644 index 000000000..828bb592c --- /dev/null +++ b/.changeset/rare-bees-beg.md @@ -0,0 +1,5 @@ +--- +"@bigcommerce/catalyst-core": patch +--- + +fix custom 404 page not being used diff --git a/core/app/[locale]/(default)/[...rest]/page.tsx b/core/app/[locale]/(default)/[...rest]/page.tsx new file mode 100644 index 000000000..71d405070 --- /dev/null +++ b/core/app/[locale]/(default)/[...rest]/page.tsx @@ -0,0 +1,5 @@ +import { notFound } from 'next/navigation'; + +export default function CatchAllPage() { + notFound(); +} diff --git a/core/tests/ui/desktop/e2e/404.spec.ts b/core/tests/ui/desktop/e2e/404.spec.ts new file mode 100644 index 000000000..38a46dbab --- /dev/null +++ b/core/tests/ui/desktop/e2e/404.spec.ts @@ -0,0 +1,7 @@ +import { expect, test } from '@playwright/test'; + +test('404 page', async ({ page }) => { + await page.goto('/unknown-url'); + + await expect(page.getByRole('heading', { name: "We couldn't find that page!" })).toBeVisible(); +});