"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
var _react = _interopRequireDefault(require("react"));
var _SidebarHeaderNext = _interopRequireDefault(require("../SidebarHeaderNext"));
var _SidebarNextContext = require("../../SidebarNext/SidebarNextContext");
var _Box = _interopRequireDefault(require("../../Box"));
var _storybookSnapper = require("storybook-snapper");
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/SidebarHeaderNext/test/SidebarHeaderNext.visual.jsx",
  _this = void 0;
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
var tests = [{
  describe: 'Title',
  its: [{
    it: 'Should display a title',
    props: {
      title: 'Title'
    }
  }, {
    it: 'Should display a title with ellipsis',
    props: {
      title: 'This is a very long title which exceeds the maximum width of its container'
    }
  }]
}, {
  describe: 'Subtitle',
  its: [{
    it: 'Should display a subtitle',
    props: {
      subtitle: 'Subtitle'
    }
  }, {
    it: 'Should display a subtitle with ellipsis',
    props: {
      title: 'This is a very long subtitle which exceeds the maximum width of its container'
    }
  }]
}, {
  describe: 'Children',
  its: [{
    it: 'Should render the given children below the title and subtitle',
    props: {
      title: 'Title',
      subtitle: 'Subtitle',
      children: /*#__PURE__*/_react["default"].createElement("div", {
        __self: void 0,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 53,
          columnNumber: 21
        }
      }, "Children")
    }
  }, {
    it: 'Should display the given children without title or subtitle',
    props: {
      children: /*#__PURE__*/_react["default"].createElement("div", {
        __self: void 0,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 59,
          columnNumber: 21
        }
      }, "Children")
    }
  }]
}, {
  describe: 'Light skin',
  its: [{
    it: 'Should render with light skin',
    props: {
      title: 'Title',
      subtitle: 'Subtitle',
      children: /*#__PURE__*/_react["default"].createElement("div", {
        __self: void 0,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 72,
          columnNumber: 21
        }
      }, "Children")
    },
    context: {
      skin: 'light'
    }
  }]
}];
var defaultContext = {
  skin: 'dark'
};
tests.forEach(function (_ref) {
  var describe = _ref.describe,
    its = _ref.its;
  (0, _storybookSnapper.visualize)("SidebarHeaderNext", function () {
    (0, _storybookSnapper.snap)(describe, function () {
      return /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, {
        __self: _this,
        __source: {
          fileName: _jsxFileName,
          lineNumber: 89,
          columnNumber: 7
        }
      }, its.map(function (_ref2, id) {
        var props = _ref2.props,
          _ref2$context = _ref2.context,
          context = _ref2$context === void 0 ? {} : _ref2$context;
        return /*#__PURE__*/_react["default"].createElement(_Box["default"], {
          backgroundColor: "D70",
          width: "228px",
          key: id,
          __self: _this,
          __source: {
            fileName: _jsxFileName,
            lineNumber: 91,
            columnNumber: 11
          }
        }, /*#__PURE__*/_react["default"].createElement(_SidebarNextContext.SidebarNextContext.Provider, {
          value: _objectSpread(_objectSpread({}, defaultContext), {}, {
            context: context
          }),
          __self: _this,
          __source: {
            fileName: _jsxFileName,
            lineNumber: 92,
            columnNumber: 13
          }
        }, /*#__PURE__*/_react["default"].createElement(_SidebarHeaderNext["default"], (0, _extends2["default"])({}, props, {
          __self: _this,
          __source: {
            fileName: _jsxFileName,
            lineNumber: 93,
            columnNumber: 15
          }
        }))));
      }));
    });
  });
});