import { render, screen } from "@testing-library/react"; import { Radio } from "../../components/Radio"; import { RadioSet } from "../../components/RadioSet"; import { axe } from "jest-axe"; describe("RadioSet", () => { test("Should render component correctly.", () => { const { container } = render( undefined}>Radio ); expect(container.firstChild).toMatchSnapshot(); }); }); describe("Accessibility", () => { test("Should have no accessibility violations.", async () => { const { container } = render( undefined}>Radio ); const results = await axe(container); expect(results).toHaveNoViolations(); }); }); describe("Props", () => { test("Should render children correctly.", () => { render( undefined}>Radio
Div
); expect(screen.getByRole("list")).not.toHaveTextContent("Div"); expect(screen.getByRole("list")).toHaveTextContent("Radio"); }); });