"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 _unit = require("../../utils/test-utils/unit");
var _MobilePreviewWidget = _interopRequireDefault(require("../MobilePreviewWidget"));
var _MobilePreviewWidgetPrivateUni = require("./MobilePreviewWidget.private.uni.driver");
var _Box = _interopRequireDefault(require("../../Box"));
var _Text = _interopRequireDefault(require("../../Text"));
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/MobilePreviewWidget/test/MobilePreviewWidget.spec.jsx",
  _this = void 0;
var requiredProps = {
  children: /*#__PURE__*/_react["default"].createElement(_Box["default"], {
    align: "center",
    verticalAlign: "middle",
    height: "100%",
    padding: "20px",
    backgroundColor: "Y30",
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 15,
      columnNumber: 5
    }
  }, /*#__PURE__*/_react["default"].createElement(_Text["default"], {
    __self: void 0,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 22,
      columnNumber: 7
    }
  }, "Content goes here"))
};
describe('MobilePreviewWidget', function () {
  var render = (0, _unit.createRendererWithUniDriver)(_MobilePreviewWidgetPrivateUni.mobilePreviewWidgetPrivateDriverFactory);
  afterEach(_unit.cleanup);
  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(_MobilePreviewWidget["default"], (0, _extends2["default"])({}, requiredProps, {
            __self: _this,
            __source: {
              fileName: _jsxFileName,
              lineNumber: 35,
              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);
  })));
  it('should render the mobile preview content', /*#__PURE__*/(0, _asyncToGenerator2["default"])(/*#__PURE__*/_regenerator["default"].mark(function _callee2() {
    var mobilePreviewContent, props, _render2, driver;
    return _regenerator["default"].wrap(function _callee2$(_context2) {
      while (1) switch (_context2.prev = _context2.next) {
        case 0:
          mobilePreviewContent = 'mobile-preview-content';
          props = {
            children: /*#__PURE__*/_react["default"].createElement("div", {
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 43,
                columnNumber: 17
              }
            }, mobilePreviewContent)
          };
          _render2 = render(/*#__PURE__*/_react["default"].createElement(_MobilePreviewWidget["default"], (0, _extends2["default"])({}, requiredProps, props, {
            __self: _this,
            __source: {
              fileName: _jsxFileName,
              lineNumber: 46,
              columnNumber: 7
            }
          }))), driver = _render2.driver;
          _context2.t0 = expect;
          _context2.next = 6;
          return driver.getMobileContent().text();
        case 6:
          _context2.t1 = _context2.sent;
          (0, _context2.t0)(_context2.t1).toBe(mobilePreviewContent);
        case 8:
        case "end":
          return _context2.stop();
      }
    }, _callee2);
  })));
});