import { render } from "@testing-library/react";
import { axe } from "vitest-axe";

import { Loader } from "../";

const example = (
  <>
    <Loader />
    <Loader>Loading</Loader>
    <Loader messages={["message 1", "message 2"]}>Loading...</Loader>
  </>
);

it("is valid html", () => {
  const { container } = render(example);
  expect(container).toHTMLValidate();
});

it("is accessible", async () => {
  const { container } = render(example);
  expect(await axe(container)).toHaveNoViolations();
});
