UNPKG

@netdata/netdata-ui

Version:

netdata UI kit

48 lines 978 B
import flex from "./flex"; it("renders", function () { expect(flex({})).toBe(""); }); it("renders flex", function () { expect(flex({ flex: true })).toBe("flex: 1 1 auto;"); }); it("renders no flex", function () { expect(flex({ flex: false })).toBe("flex: 0 0 auto;"); }); it("renders flex grow", function () { expect(flex({ flex: "grow" })).toBe("flex: 1 0 auto;"); }); it("renders flex grow", function () { expect(flex({ flex: "shrink" })).toBe("flex: 0 1 auto;"); }); it("renders fixed flex", function () { expect(flex({ flex: 2 })).toBe("flex: 2 0 auto;"); }); it("renders configured flex", function () { expect(flex({ flex: { grow: 3, shrink: 1 } })).toBe("flex: 3 1 auto;"); }); it("renders basis", function () { expect(flex({ basis: "50%" })).toBe("flex-basis: 50%;"); }); it("renders flex and basis", function () { expect(flex({ flex: true, basis: "3px" })).toBe("flex: 1 1 3px;"); });