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

import { Cover } from "../";

const example = (
  <>
    <Cover bgSrc="https://placehold.co/800x150" />;
    <Cover
      bgSrc={{
        default: "https://placehold.co/800x300",
        lg: "https://placehold.co/2560x1000",
        md: "https://placehold.co/1200x500",
      }}
    />
  </>
);

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

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