import { render, fireEvent, screen } from "@testing-library/react"; import { Ripple } from "../../components/Ripple/Ripple"; import { axe } from "jest-axe"; describe("Ripple", () => { test("Should render component corectly.", () => { const { container } = render(); expect(container.firstChild).toMatchSnapshot(); }); }); describe("Accessibility", () => { test("Should have no accessibility violations.", async () => { const { container } = render(); const results = await axe(container); expect(results).toHaveNoViolations(); }); }); describe("Interaction", () => { test("Should addRipple on userEvent.", () => { render(); fireEvent.mouseDown(screen.getByRole("presentation")); expect( screen.getAllByRole("presentation")[1] ).toBeInTheDocument(); }); });