import React from "react";
import "@testing-library/jest-dom/extend-expect";
import { render } from "@testing-library/react";
import Progress from "../progress";

test("shows progress", () => {
  const { queryByTestId } = render(
    <Progress>
      <span data-testid="children-123">123</span>
    </Progress>
  );

  expect(queryByTestId("honeyui-progress")).toBeTruthy();
  expect(queryByTestId("honeyui-progress")).toHaveClass("progress");
});

test("shows progress with children", () => {
  const { queryByTestId } = render(
    <Progress>
      <span data-testid="children-123">123</span>
    </Progress>
  );

  expect(queryByTestId("children-123")).toBeTruthy();
});

test("shows progress with height", () => {
  const { queryByTestId } = render(
    <Progress height={50}>
      <span data-testid="children-123">123</span>
    </Progress>
  );
  expect(queryByTestId("honeyui-progress").style.height).toBe("50px");
});
