"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
var _react = _interopRequireDefault(require("react"));
var _react2 = require("@storybook/react");
var _wixUiIconsCommon = require("@wix/wix-ui-icons-common");
var _FunnelChart = _interopRequireDefault(require("../FunnelChart"));
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/FunnelChart/test/FunnelChart.visual.jsx",
  _this = void 0;
var commonProps = {
  data: [{
    value: 1000,
    label: 'visits',
    displayValue: '1K'
  }, {
    value: 800,
    label: 'views'
  }, {
    value: 400,
    label: 'cart'
  }]
};
var tests = [{
  describe: 'sanity',
  its: [{
    it: '3 items',
    props: {
      data: commonProps.data
    }
  }, {
    it: '3 items no badges',
    props: {
      data: commonProps.data,
      hideDifferenceBadge: true
    }
  }, {
    it: 'last item value is zero',
    props: {
      data: [].concat((0, _toConsumableArray2["default"])(commonProps.data), [{
        value: 0,
        label: 'checkout',
        displayValue: '-'
      }])
    }
  }, {
    it: 'dark badges',
    props: {
      data: commonProps.data,
      differenceBadgeSkin: 'dark'
    }
  }, {
    it: 'full height',
    props: {
      data: commonProps.data,
      fullHeight: true
    }
  }, {
    it: '2nd step and its badge have success skin',
    props: {
      data: commonProps.data,
      differenceStepSkin: function differenceStepSkin(_ref) {
        var currentIndex = _ref.currentIndex;
        return currentIndex === 1 ? 'success' : 'standard';
      },
      differenceBadgeProps: function differenceBadgeProps(_ref2) {
        var currentIndex = _ref2.currentIndex;
        return {
          skin: currentIndex === 1 ? 'success' : 'standard'
        };
      }
    }
  }, {
    it: '1st and 3rd steps and their badges have icons',
    props: {
      data: [].concat((0, _toConsumableArray2["default"])(commonProps.data), [{
        value: 350,
        label: 'checkout',
        displayValue: '-'
      }]),
      differenceBadgeProps: function differenceBadgeProps(_ref3) {
        var currentIndex = _ref3.currentIndex;
        return {
          prefixIcon: currentIndex !== 1 ? /*#__PURE__*/_react["default"].createElement(_wixUiIconsCommon.BuildSmall, {
            __self: this,
            __source: {
              fileName: _jsxFileName,
              lineNumber: 77,
              columnNumber: 48
            }
          }) : null
        };
      }
    }
  }]
}];
tests.forEach(function (_ref4) {
  var describe = _ref4.describe,
    its = _ref4.its;
  its.forEach(function (_ref5) {
    var it = _ref5.it,
      props = _ref5.props;
    (0, _react2.storiesOf)("".concat(_FunnelChart["default"].displayName).concat(describe ? '/' + describe : ''), module).add(it, function () {
      return /*#__PURE__*/_react["default"].createElement("div", {
        style: {
          height: '250px'
        },
        __self: _this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 92,
          columnNumber: 7
        }
      }, /*#__PURE__*/_react["default"].createElement(_FunnelChart["default"], (0, _extends2["default"])({}, commonProps, props, {
        __self: _this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 93,
          columnNumber: 9
        }
      })));
    });
  });
});