// @vitest-environment jsdom import { cleanup, fireEvent, render, screen } from "@testing-library/react"; import { afterEach, describe, expect, it, vi } from "vitest"; import { SwitchControl } from "./boolean-controls"; afterEach(cleanup); describe("SwitchControl accessible name", () => { it.each([true, false])( "retains the control name with showLabel=%s", (showLabel) => { const onCheckedChange = vi.fn(); render( , ); fireEvent.click(screen.getByRole("switch", { name: "Lock rotation" })); expect(onCheckedChange).toHaveBeenCalledWith(true); }, ); });