import React from "react";
import { render } from "@testing-library/react";
import "@testing-library/jest-dom";
import { StockChartProps } from "../StockChartProps";
import StockChart from "../StockChart";

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

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

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