"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
var _react = _interopRequireDefault(require("react"));
var _wixUiIconsCommon = require("@wix/wix-ui-icons-common");
var _unit = require("../../utils/test-utils/unit");
var _MarketingLayout = _interopRequireDefault(require("../MarketingLayout"));
var _Button = _interopRequireDefault(require("../../Button"));
var _MarketingLayoutPrivateUni = require("./MarketingLayout.private.uni.driver");
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/MarketingLayout/test/MarketingLayout.spec.jsx",
  _this = void 0;
describe('MarketingLayout', function () {
  var render = (0, _unit.createRendererWithUniDriver)(_MarketingLayoutPrivateUni.marketingLayoutPrivateDriverFactory);
  afterEach(function () {
    (0, _unit.cleanup)();
  });
  var defaultProps = {
    image: /*#__PURE__*/_react["default"].createElement(_wixUiIconsCommon.Add, {
      __self: _this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 22,
        columnNumber: 12
      }
    }),
    title: /*#__PURE__*/_react["default"].createElement("h1", {
      __self: _this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 23,
        columnNumber: 12
      }
    }, "title"),
    description: 'Card description',
    actions: /*#__PURE__*/_react["default"].createElement(_Button["default"], {
      __self: _this,
      __source: {
        fileName: _jsxFileName,
        lineNumber: 25,
        columnNumber: 14
      }
    }, "Card action"),
    alignItems: 'center'
  };
  it('should render', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee() {
    var _render, driver;
    return _regenerator["default"].wrap(function _callee$(_context) {
      while (1) switch (_context.prev = _context.next) {
        case 0:
          _render = render(/*#__PURE__*/_react["default"].createElement(_MarketingLayout["default"], (0, _extends2["default"])({}, defaultProps, {
            __self: _this,
            __source: {
              fileName: _jsxFileName,
              lineNumber: 30,
              columnNumber: 31
            }
          }))), driver = _render.driver;
          _context.t0 = expect;
          _context.next = 4;
          return driver.exists();
        case 4:
          _context.t1 = _context.sent;
          (0, _context.t0)(_context.t1).toBe(true);
        case 6:
        case "end":
          return _context.stop();
      }
    }, _callee);
  })));
  describe('`title` prop', function () {
    it('should render as string', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2() {
      var _render2, driver;
      return _regenerator["default"].wrap(function _callee2$(_context2) {
        while (1) switch (_context2.prev = _context2.next) {
          case 0:
            _render2 = render(/*#__PURE__*/_react["default"].createElement(_MarketingLayout["default"], (0, _extends2["default"])({}, defaultProps, {
              title: "Card Title",
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 37,
                columnNumber: 9
              }
            }))), driver = _render2.driver;
            _context2.t0 = expect;
            _context2.next = 4;
            return driver.getTitleText();
          case 4:
            _context2.t1 = _context2.sent;
            (0, _context2.t0)(_context2.t1).toBe('Card Title');
          case 6:
          case "end":
            return _context2.stop();
        }
      }, _callee2);
    })));
    it('should render as component', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee3() {
      var _render3, driver;
      return _regenerator["default"].wrap(function _callee3$(_context3) {
        while (1) switch (_context3.prev = _context3.next) {
          case 0:
            _render3 = render(/*#__PURE__*/_react["default"].createElement(_MarketingLayout["default"], (0, _extends2["default"])({}, defaultProps, {
              title: /*#__PURE__*/_react["default"].createElement("h1", {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 44,
                  columnNumber: 51
                }
              }, "Card Title"),
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 44,
                columnNumber: 9
              }
            }))), driver = _render3.driver;
            _context3.t0 = expect;
            _context3.next = 4;
            return driver.getTitleText();
          case 4:
            _context3.t1 = _context3.sent;
            (0, _context3.t0)(_context3.t1).toBe('Card Title');
          case 6:
          case "end":
            return _context3.stop();
        }
      }, _callee3);
    })));
  });
  describe('`description` prop', function () {
    it('should render as string', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee4() {
      var _render4, driver;
      return _regenerator["default"].wrap(function _callee4$(_context4) {
        while (1) switch (_context4.prev = _context4.next) {
          case 0:
            _render4 = render(/*#__PURE__*/_react["default"].createElement(_MarketingLayout["default"], (0, _extends2["default"])({}, defaultProps, {
              description: "Card Description",
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 53,
                columnNumber: 9
              }
            }))), driver = _render4.driver;
            _context4.t0 = expect;
            _context4.next = 4;
            return driver.getDescriptionText();
          case 4:
            _context4.t1 = _context4.sent;
            (0, _context4.t0)(_context4.t1).toBe('Card Description');
          case 6:
          case "end":
            return _context4.stop();
        }
      }, _callee4);
    })));
    it('should render as component', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee5() {
      var _render5, driver;
      return _regenerator["default"].wrap(function _callee5$(_context5) {
        while (1) switch (_context5.prev = _context5.next) {
          case 0:
            _render5 = render(/*#__PURE__*/_react["default"].createElement(_MarketingLayout["default"], (0, _extends2["default"])({}, defaultProps, {
              description: /*#__PURE__*/_react["default"].createElement("p", {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 62,
                  columnNumber: 24
                }
              }, "Card Description"),
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 60,
                columnNumber: 9
              }
            }))), driver = _render5.driver;
            _context5.t0 = expect;
            _context5.next = 4;
            return driver.getDescriptionText();
          case 4:
            _context5.t1 = _context5.sent;
            (0, _context5.t0)(_context5.t1).toBe('Card Description');
          case 6:
          case "end":
            return _context5.stop();
        }
      }, _callee5);
    })));
  });
});