Skip to content

Commit

Permalink
fix: 🐛 show not found when deployed
Browse files Browse the repository at this point in the history
  • Loading branch information
jimmy-guzman committed Oct 29, 2024
1 parent 6fa1ce4 commit 39f7e63
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions e2e/app.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ test("has title", async ({ page }) => {
await expect(page).toHaveTitle(/React Starter/);
});

test("not found", async ({ page }) => {
await page.goto("/lost");

await expect(page).toHaveTitle(/React Starter/);

await expect(
page.getByRole("heading", { name: "Error", level: 1 }),
).toBeInViewport();
});

test.describe("external links", () => {
test.beforeEach(async ({ page }) => {
await page.goto("/");
Expand Down
1 change: 1 addition & 0 deletions src/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const router = createRouter({
routeTree,
defaultNotFoundComponent: NotFound,
defaultErrorComponent: Error,
notFoundMode: "root",
});

declare module "@tanstack/react-router" {
Expand Down

0 comments on commit 39f7e63

Please sign in to comment.