"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _typeof = require("@babel/runtime/helpers/typeof");
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _react = _interopRequireDefault(require("react"));
var _react2 = require("@storybook/react");
var _ComposerSidebar = _interopRequireDefault(require("../ComposerSidebar"));
var Icons = _interopRequireWildcard(require("@wix/wix-ui-icons-common"));
var _constants = require("../constants");
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/ComposerSidebar/test/ComposerSidebar.visual.jsx",
  _this = void 0;
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
var commonProps = {
  items: _constants.items,
  selectedId: 1
};
var tests = [{
  describe: 'size with bottom labelPlacement',
  its: [{
    it: 'medium',
    props: {
      size: 'medium',
      labelPlacement: 'bottom'
    }
  }, {
    it: 'large',
    props: {
      size: 'large',
      labelPlacement: 'bottom'
    }
  }, {
    it: 'small',
    props: {
      size: 'small',
      labelPlacement: 'bottom'
    }
  }]
}, {
  describe: 'size',
  its: [{
    it: 'medium',
    props: {
      size: 'medium'
    }
  }, {
    it: 'large',
    props: {
      size: 'large'
    }
  }, {
    it: 'small',
    props: {
      size: 'small'
    }
  }]
}, {
  describe: 'labelPlacement',
  its: [{
    it: 'end',
    props: {
      labelPlacement: 'end'
    }
  }, {
    it: 'bottom',
    props: {
      labelPlacement: 'bottom'
    }
  }, {
    it: 'tooltip',
    props: {
      labelPlacement: 'tooltip'
    }
  }]
}, {
  describe: 'disabled',
  its: [{
    it: 'true',
    props: {
      items: _constants.disabledItems
    }
  }]
}, {
  describe: 'sections',
  its: [{
    it: 'should put items in sections',
    props: {
      items: _constants.itemsWithSections
    }
  }]
}, {
  describe: 'width',
  its: [{
    it: 'end label placement 300',
    props: {
      labelPlacement: 'end',
      width: 300
    }
  }, {
    it: 'bottom label placement 300px',
    props: {
      labelPlacement: 'bottom',
      width: '300px'
    }
  }, {
    it: 'tooltip label placement 100%',
    props: {
      labelPlacement: 'tooltip',
      width: '100%'
    }
  }]
}, {
  describe: 'ellipsis',
  its: [{
    it: 'false & labelPlacement bottom',
    props: {
      ellipsis: false,
      labelPlacement: 'bottom',
      items: [{
        id: 0,
        label: 'Very long label that should not be ellipsis',
        icon: /*#__PURE__*/_react["default"].createElement(Icons.CropRotate, {
          __self: void 0,
          __source: {
            fileName: _jsxFileName,
            lineNumber: 145,
            columnNumber: 21
          }
        })
      }]
    }
  }, {
    it: 'false & labelPlacement end',
    props: {
      ellipsis: false,
      labelPlacement: 'end',
      items: [{
        id: 0,
        label: 'Very long label that should not be ellipsis',
        icon: /*#__PURE__*/_react["default"].createElement(Icons.CropRotate, {
          __self: void 0,
          __source: {
            fileName: _jsxFileName,
            lineNumber: 159,
            columnNumber: 21
          }
        })
      }]
    }
  }, {
    it: 'true & labelPlacement bottom',
    props: {
      ellipsis: true,
      labelPlacement: 'bottom',
      items: [{
        id: 0,
        label: 'Very long label that should be ellipsis',
        icon: /*#__PURE__*/_react["default"].createElement(Icons.CropRotate, {
          __self: void 0,
          __source: {
            fileName: _jsxFileName,
            lineNumber: 173,
            columnNumber: 21
          }
        })
      }]
    }
  }, {
    it: 'true & labelPlacement end',
    props: {
      ellipsis: true,
      labelPlacement: 'end',
      items: [{
        id: 0,
        label: 'Very long label that should be ellipsis',
        icon: /*#__PURE__*/_react["default"].createElement(Icons.CropRotate, {
          __self: void 0,
          __source: {
            fileName: _jsxFileName,
            lineNumber: 187,
            columnNumber: 21
          }
        })
      }]
    }
  }]
}];
tests.forEach(function (_ref) {
  var describe = _ref.describe,
    its = _ref.its;
  its.forEach(function (_ref2) {
    var it = _ref2.it,
      props = _ref2.props;
    (0, _react2.storiesOf)("".concat(_ComposerSidebar["default"].displayName).concat(describe ? '/' + describe : ''), module).add(it, function () {
      return /*#__PURE__*/_react["default"].createElement(_ComposerSidebar["default"], (0, _extends2["default"])({}, commonProps, props, {
        __self: _this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 201,
          columnNumber: 21
        }
      }));
    });
  });
});