import { render, screen } from "@testing-library/react"; import { describe, expect, it } from "vitest"; import { Checkbox } from "./checkbox"; describe("Checkbox Component", () => { it("adds a fallback id for browser autofill diagnostics", () => { render(); expect(screen.getByRole("checkbox")).toHaveAttribute("id"); }); it("keeps explicit id and name values", () => { render(); const checkbox = screen.getByRole("checkbox"); expect(checkbox).toHaveAttribute("id", "explicit-checkbox"); expect(checkbox).toHaveAttribute("name", "explicit-name"); }); });