import React from "react";
import { render } from "@testing-library/react";
import Chart from "../Chart";
import { ChartProps } from "../ChartProps";
import "hammerjs";

describe("Chart Component", () => {
  const props: ChartProps = {
    dataTestId: "test-id",
    children: <div>children</div>,
    axisDefaults: {},
    className: "className",
    dir: "dir",
    drilldownState: { steps: [] },
    paneDefaults: {},
    panes: [],
    pannable: true,
    renderAs: "svg",
    seriesColors: [],
    seriesDefaults: {},
    style: {},
    transitions: true,
    zoomable: true,
  };

  it("renders all props correctly", () => {
    render(<Chart {...props} />);
  });

  it("matches snapshot", () => {
    const { asFragment } = render(<Chart {...props} />);
    expect(asFragment()).toMatchSnapshot();
  });
});
