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

import { TagButton } from "../TagButton";

const example = (
  <>
    <TagButton iconName="close" ariaLabel="Close" />
    <TagButton iconName="search" ariaLabel="Search" size="large" />
    <TagButton iconName="edit" ariaLabel="Edit" isDisabled />
  </>
);

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

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