"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
var _react = _interopRequireDefault(require("react"));
var _userEvent = _interopRequireDefault(require("@testing-library/user-event"));
var _react2 = require("../../utils/test-utils/react");
var _ColorInputUni = require("../ColorInput.uni.driver");
var _ColorInput = _interopRequireDefault(require("../ColorInput"));
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/cjs/ColorInput/test/ColorInput.spec.jsx";
describe('ColorInput', function () {
  describe('[async]', function () {
    runTests((0, _react2.createRendererWithUniDriver)(_ColorInputUni.colorInputDriverFactory));
  });
  function runTests(render) {
    var _this = this;
    describe('rendering the ColorInput', function () {
      it('should remove the popover after tabOut', /*#__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(_ColorInput["default"], {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 15,
                  columnNumber: 35
                }
              })), driver = _render.driver;
              _context.next = 3;
              return driver.click();
            case 3:
              _context.t0 = expect;
              _context.next = 6;
              return driver.colorPickerVisible();
            case 6:
              _context.t1 = _context.sent;
              (0, _context.t0)(_context.t1).toBeTruthy();
              _context.next = 10;
              return _userEvent["default"].tab();
            case 10:
              _context.next = 12;
              return _userEvent["default"].tab();
            case 12:
              _context.next = 14;
              return _userEvent["default"].tab();
            case 14:
              _context.next = 16;
              return _userEvent["default"].tab();
            case 16:
              _context.next = 18;
              return _userEvent["default"].tab();
            case 18:
              _context.next = 20;
              return _userEvent["default"].tab();
            case 20:
              _context.t2 = expect;
              _context.next = 23;
              return driver.colorPickerVisible();
            case 23:
              _context.t3 = _context.sent;
              (0, _context.t2)(_context.t3).toBeFalsy();
            case 25:
            case "end":
              return _context.stop();
          }
        }, _callee);
      })));
    });
  }
});