import { render, screen } from "@testing-library/react"; import userEvent from "@testing-library/user-event"; import type { InputHTMLAttributes, ReactNode } from "react"; import { describe, expect, it, vi } from "vitest"; const { notificationIndicatorMock } = vi.hoisted(() => ({ notificationIndicatorMock: vi.fn(), })); // --------------------------------------------------------------------------- // Hoist mocks for dependencies // --------------------------------------------------------------------------- vi.mock("next/navigation", () => ({ redirect: vi.fn(), useRouter: () => ({ refresh: vi.fn() }), usePathname: () => "/findings", useSearchParams: () => new URLSearchParams(), })); vi.mock("@/components/shadcn", async (importOriginal) => ({ ...(await importOriginal>()), Button: ({ children, ...props }: { children: ReactNode }) => ( ), Checkbox: ({ "aria-label": ariaLabel, onCheckedChange, ...props }: InputHTMLAttributes & { "aria-label"?: string; size?: string; onCheckedChange?: (checked: boolean) => void; }) => ( onCheckedChange?.(event.target.checked)} {...props} /> ), Textarea: (props: InputHTMLAttributes) => (