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

import { Carousel } from "..";

const example = (
  <>
    <Carousel
      items={Array(5)
        .fill()
        .map((_, index) => <div key={index.toString()}>slide {index}</div>)}
    />
  </>
);

it("is valid html", () => {
  const { container } = render(example);
  expect(container).toHTMLValidate({ rules: { "no-inline-style": "off" } });
});

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