diff --git a/AGENTS.md b/AGENTS.md index 4716a98..f63d4e2 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -366,6 +366,10 @@ describe("Component", () => { - Loading states - Accessibility +### Testing Best Practices + +- **Prefer `toBeVisible()` over `toBeInTheDocument()`** - `toBeVisible()` checks that an element is actually visible to the user (not hidden via CSS, `aria-hidden`, etc.), while `toBeInTheDocument()` only checks DOM presence. Use `toBeVisible()` for positive assertions and `.not.toBeInTheDocument()` for absence checks. + ## Common Mistakes ### 1. Client Components Everywhere diff --git a/src/app/global-error.tsx b/src/app/global-error.tsx new file mode 100644 index 0000000..7100fd1 --- /dev/null +++ b/src/app/global-error.tsx @@ -0,0 +1,40 @@ +"use client"; + +import { Inter } from "next/font/google"; +import { ToolHiveIcon } from "@/components/icons"; +import { Button } from "@/components/ui/button"; +import "./globals.css"; + +const inter = Inter({ + variable: "--font-inter", + subsets: ["latin"], +}); + +interface GlobalErrorProps { + reset: () => void; +} + +export default function GlobalError({ reset }: GlobalErrorProps) { + return ( + +
+