import { renderBackground } from "../background";
import { linearGradient } from "polished";

describe("background", () => {
  const theme = {
    SIMPLE_BG: "#000000",
    GRADIENT_BG: linearGradient({
      colorStops: [`#000000 95%`, `#000000 100%`],
      toDirection: "to bottom",
      fallback: "#000000",
    }),
  };

  it("retrieves functions that accept the theme", () => {
    expect(typeof renderBackground()).toBe("function");
  });

  it("renderBackground", () => {
    expect(renderBackground("SIMPLE_BG", "DEFAULT")({ theme })).toBe(
      "background: #000000",
    );
    expect(renderBackground("GRADIENT_BG", "DEFAULT")({ theme })).toStrictEqual(
      {
        backgroundColor: "#000000",
        backgroundImage:
          "linear-gradient(to bottom, #000000 95%, #000000 100%)",
      },
    );
  });
});
