import React from "react";
import { render } from "@testing-library/react";
import "@testing-library/jest-dom";
import { PDFExportProps } from "../../PDFExport/PDFExportProps";
import GridPDFExport from "../GridPDFExport";

describe("GridPDFExport Component", () => {
  const props: PDFExportProps = {
    author: "Test Author",
    avoidLinks: true,
    creator: "Test Creator",
    date: new Date("2023-12-14"),
    fileName: "test_export.pdf",
    forcePageBreak: ".page-break",
    forceProxy: true,
    imageResolution: 300,
    keepTogether: ".keep-together",
    keywords: "test, pdf, export",
    landscape: true,
    margin: { top: 20, right: 20, bottom: 20, left: 20 },
    pageTemplate: "<div>Page 1</div>",
    paperSize: "A4",
    producer: "Test Producer",
    proxyData: { key1: "value1", key2: "value2" },
    proxyTarget: "_blank",
    proxyURL: "http://example.com/proxy",
    repeatHeaders: true,
    scale: 0.8,
    subject: "Test Subject",
    title: "Test Title",
  };

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

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