import { renderHook } from "@testing-library/react";
import { useValidationClasses } from "./useValidationClasses";

describe("useValidationClasses", () => {
  describe("given isInvalid is set to true", () => {
    it("should return '--is-invalid'", () => {
      const { result } = renderHook(() =>
        useValidationClasses({ isInvalid: true }),
      );

      expect(result.current).toBe("--is-invalid");
    });
  });

  describe("given isInvalid is set to false", () => {
    it("should return '--is-valid'", () => {
      const { result } = renderHook(() =>
        useValidationClasses({ isInvalid: false }),
      );

      expect(result.current).toBe("--is-valid");
    });
  });

  describe("given isInvalid is set to undefined", () => {
    it("should return an empty string", () => {
      const { result } = renderHook(() =>
        useValidationClasses({ isInvalid: undefined }),
      );

      expect(result.current).toBe("");
    });
  });
});
