import React from "react";
import "jest-styled-components/native";
import { render } from "@testing-library/react-native";
import { AtomIcon } from "./index";

describe("Icon Atom", () => {
  const icon = "diamond";
  const size = 65;

  test("Render Icon", () => {
    const element = render(<AtomIcon name={icon} size={size} />);

    const iconElement = element.getByTestId("icon") as SVGSVGElement;
    expect(iconElement).toBeTruthy();
  });

  it("Should have the correct height", () => {
    const element = render(<AtomIcon name={icon} size={size} />);

    const iconElement = element.getByTestId("icon") as SVGSVGElement;
    expect(iconElement).toHaveStyleRule("height", size);
  });
});
