forked from Lilly-Protocol/lily-frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnot-found.test.tsx
More file actions
30 lines (25 loc) · 903 Bytes
/
Copy pathnot-found.test.tsx
File metadata and controls
30 lines (25 loc) · 903 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { render, screen } from "@testing-library/react";
import { routes, siteConfig } from "@/config/site";
import NotFound, { metadata } from "./not-found";
describe("NotFound", () => {
it("exports not-found metadata for the global 404 route", () => {
expect(metadata).toMatchObject({
title: "Page not found",
description: `The requested ${siteConfig.name} page could not be found.`,
});
});
it("renders a branded 404 with a home route link", () => {
render(<NotFound />);
expect(screen.getByRole("main")).toBeInTheDocument();
expect(
screen.getByRole("heading", { level: 1, name: /page not found/i }),
).toBeInTheDocument();
expect(screen.getByText("404")).toHaveClass(
"text-[var(--color-accent)]",
);
expect(screen.getByRole("link", { name: /return home/i })).toHaveAttribute(
"href",
routes.home,
);
});
});