"use strict";

var _default = require("../theme/default");
var _margin = _interopRequireDefault(require("./margin"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
it("renders nothing", function () {
  expect((0, _margin["default"])({
    theme: _default.DefaultTheme
  })).toBe("");
});
it("renders margin 0px", function () {
  expect((0, _margin["default"])({
    theme: _default.DefaultTheme,
    margin: [0]
  })).toBe("margin: 0;");
});
it("renders margin 4px 16px", function () {
  expect((0, _margin["default"])({
    theme: _default.DefaultTheme,
    margin: [1, 4]
  })).toBe("margin: 4px 16px;");
});
it("renders margin 8px 12px 16px", function () {
  expect((0, _margin["default"])({
    theme: _default.DefaultTheme,
    margin: [2, 3, 4]
  })).toBe("margin: 8px 12px 16px;");
});
it("renders margin 8px 12px 16px 32px", function () {
  expect((0, _margin["default"])({
    theme: _default.DefaultTheme,
    margin: [2, 3, 4, 7]
  })).toBe("margin: 8px 12px 16px 28px;");
});
it("renders margin on invalid value 8px auto", function () {
  expect((0, _margin["default"])({
    theme: _default.DefaultTheme,
    margin: [2, "auto"]
  })).toBe("margin: 8px auto;");
});
it("logs error", function () {
  console.error = jest.fn();
  (0, _margin["default"])({
    theme: _default.DefaultTheme,
    margin: "invalid"
  });
  (0, _margin["default"])({
    theme: _default.DefaultTheme,
    margin: {}
  });
  (0, _margin["default"])({
    theme: _default.DefaultTheme,
    margin: []
  });
  (0, _margin["default"])({
    theme: _default.DefaultTheme,
    margin: [1, 2, 3, 4, 5, 6]
  });
  expect(console.error).toHaveBeenCalledTimes(4);
});