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

describe("ChunkProgressBar Component", () => {
  const props: ChunkProgressBarProps = {
    ariaLabel: "Chunk Progress",
    chunkCount: 5,
    className: "custom-chunk-progressbar",
    dir: "ltr",
    disabled: false,
    emptyClassName: "empty-chunk-class",
    emptyStyle: { backgroundColor: "lightgrey" },
    max: 100,
    min: 0,
    orientation: "horizontal",
    progressClassName: "full-chunk-class",
    progressStyle: { backgroundColor: "green" },
    reverse: false,
    style: { height: "25px" },
    tabIndex: 0,
    value: 30,
  };

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

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