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

import { Hero } from "../";

import { fullwidthImages } from "./data";

const example = (
  <Hero
    title="Ušetrite až 100&nbsp;€ pri kúpe hernej konzoly"
    description="Nezmeškajte štedrú ponuku od Orangeu a získajte od nás k internetu hernú konzolu so zľavou až 100&nbsp;&euro;."
    price={{ prefix: "od ", amount: 10, suffix: "/mes." }}
    sticker={{ children: "Lorem ipsum sticker" }}
    image={fullwidthImages}
    button={{ children: "Chcem zľavu na hernú konzolu" }}
    hasFullwidthImage
  />
);

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

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