import { sizeClasses } from "./sizeClasses";
import type { SizeType } from "../types/size";

describe("sizeClasses", () => {
  describe("given the size is set", () => {
    it.each(["xxs", "xs", "sm", "md", "lg", "xl", "xxl"])(
      "it should return CSS modifier-like class name --is-%s",
      size => {
        const input = sizeClasses(size as SizeType);

        expect(input).toEqual(
          expect.objectContaining({
            [`--is-${size}`]: true,
          }),
        );
      },
    );
  });

  describe("given the size is not set", () => {
    it("should return null", () => {
      const input = undefined;

      expect(sizeClasses(input)).toEqual({});
    });
  });
});
