"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _react = _interopRequireDefault(require("react"));
var _react2 = require("@storybook/react");
var _ComposerHeader = _interopRequireDefault(require("../ComposerHeader"));
var _TextButton = _interopRequireDefault(require("../../TextButton"));
var _Button = _interopRequireDefault(require("../../Button"));
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/ComposerHeader/test/ComposerHeader.visual.jsx",
  _this = void 0;
var generateActions = function generateActions(props) {
  return /*#__PURE__*/_react["default"].createElement(_ComposerHeader["default"].Actions, (0, _extends2["default"])({}, props, {
    __self: _this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 8,
      columnNumber: 3
    }
  }), /*#__PURE__*/_react["default"].createElement(_TextButton["default"], {
    skin: "premium",
    __self: _this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 9,
      columnNumber: 5
    }
  }, "Upgrade"));
};
var generateMainActions = function generateMainActions(props) {
  return /*#__PURE__*/_react["default"].createElement(_ComposerHeader["default"].MainActions, (0, _extends2["default"])({}, props, {
    __self: _this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 14,
      columnNumber: 3
    }
  }), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
    skin: "inverted",
    __self: _this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 15,
      columnNumber: 5
    }
  }, "Preview"), /*#__PURE__*/_react["default"].createElement(_Button["default"], {
    __self: _this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 16,
      columnNumber: 5
    }
  }, "Next"));
};
var commonProps = {
  // use for repeated props across the tests (e.g. {buttonText: 'example'})
};
var tests = [{
  describe: 'Structure',
  its: [{
    it: 'back button',
    props: {
      backButtonValue: 'Back to Social Posts'
    }
  }, {
    it: 'actions',
    props: {
      children: [generateActions({
        key: 0
      }), generateActions({
        key: 1
      })]
    }
  }, {
    it: 'main actions',
    props: {
      children: generateMainActions()
    }
  }, {
    it: 'all together',
    props: {
      backButtonValue: 'Back to Social Posts',
      children: [generateActions({
        key: 0
      }), generateActions({
        key: 1,
        justifyContent: 'flex-end'
      }), generateMainActions()]
    }
  }, {
    it: 'save status',
    props: {
      backButtonValue: 'Back to Social Posts',
      saveStatusValue: 'Saving...',
      children: [generateActions({
        key: 0
      }), generateActions({
        key: 1,
        justifyContent: 'flex-end'
      }), generateMainActions()]
    }
  }]
}, {
  describe: 'Custom Structure',
  its: [{
    it: 'multiple actions',
    props: {
      backButtonValue: 'Back to Social Posts',
      saveStatusValue: 'Saving...',
      children: [generateActions({
        key: 0
      }), generateActions({
        key: 1
      }), generateActions({
        key: 2
      }), generateActions({
        key: 3,
        justifyContent: 'flex-end'
      }), generateMainActions()]
    }
  }]
}];
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)("ComposerHeader".concat(describe ? '/' + describe : ''), module).add(it, function () {
      return /*#__PURE__*/_react["default"].createElement(_ComposerHeader["default"], (0, _extends2["default"])({}, commonProps, props, {
        __self: _this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 96,
          columnNumber: 13
        }
      }));
    });
  });
});