import _extends from "@babel/runtime/helpers/extends";
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/esm/MobilePreviewWidget/test/MobilePreviewWidget.spec.jsx",
  _this = this;
import _regeneratorRuntime from "@babel/runtime/regenerator";
import React from 'react';
import { createRendererWithUniDriver, cleanup } from '../../utils/test-utils/unit';
import MobilePreviewWidget from '../MobilePreviewWidget';
import { mobilePreviewWidgetPrivateDriverFactory } from './MobilePreviewWidget.private.uni.driver';
import Box from '../../Box';
import Text from '../../Text';
var requiredProps = {
  children: /*#__PURE__*/React.createElement(Box, {
    align: "center",
    verticalAlign: "middle",
    height: "100%",
    padding: "20px",
    backgroundColor: "Y30",
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 15,
      columnNumber: 5
    }
  }, /*#__PURE__*/React.createElement(Text, {
    __self: this,
    __source: {
      fileName: _jsxFileName,
      lineNumber: 22,
      columnNumber: 7
    }
  }, "Content goes here"))
};
describe('MobilePreviewWidget', function () {
  var render = createRendererWithUniDriver(mobilePreviewWidgetPrivateDriverFactory);
  afterEach(cleanup);
  it('should render', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
    var _render, driver;
    return _regeneratorRuntime.wrap(function _callee$(_context) {
      while (1) switch (_context.prev = _context.next) {
        case 0:
          _render = render(/*#__PURE__*/React.createElement(MobilePreviewWidget, _extends({}, 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__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
    var mobilePreviewContent, props, _render2, driver;
    return _regeneratorRuntime.wrap(function _callee2$(_context2) {
      while (1) switch (_context2.prev = _context2.next) {
        case 0:
          mobilePreviewContent = 'mobile-preview-content';
          props = {
            children: /*#__PURE__*/React.createElement("div", {
              __self: _this,
              __source: {
                fileName: _jsxFileName,
                lineNumber: 43,
                columnNumber: 17
              }
            }, mobilePreviewContent)
          };
          _render2 = render(/*#__PURE__*/React.createElement(MobilePreviewWidget, _extends({}, 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);
  })));
});