UNPKG

@netdata/netdata-ui

Version:

netdata UI kit

49 lines 1.06 kB
import { DefaultTheme as theme } from "../../../theme/default"; import width from "./width"; it("renders", function () { expect(width({ theme: theme })).toBe(undefined); }); it("renders value", function () { expect(width({ theme: theme, width: "10rem" })).toBe("width: 10rem;"); expect(width({ theme: theme, width: 10 })).toBe("width: 40px;"); }); it("renders min max", function () { expect(width({ theme: theme, width: { min: "20rem", max: "45rem" } }).trim()).toBe("\n min-width: 20rem;\n max-width: 45rem;\n ".trim()); expect(width({ theme: theme, width: { min: 0.5, max: 1 } }).trim()).toBe("\n min-width: 2px;\n max-width: 4px;\n ".trim()); }); it("renders max", function () { expect(width({ theme: theme, width: { max: "45rem" } }).trim()).toBe("max-width: 45rem;"); }); it("renders min", function () { expect(width({ theme: theme, width: { min: "20rem" } }).trim()).toBe("min-width: 20rem;"); });