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

describe("ExcelExport Component", () => {
  const props: ExcelExportProps = {
    dataTestId: "test-id",
    collapsible: false,
    columns: [],
    creator: "Test Creator",
    data: [],
    date: new Date(),
    dir: "ltr",
    fileName: "TestExport.xlsx",
    filterable: false,
    forceProxy: false,
    group: [],
    headerPaddingCellOptions: {},
    hierarchy: false,
    paddingCellOptions: {},
    proxyURL: "http://example.com/proxy",
    onExportComplete: () => {},
  };

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

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