import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/esm/FilePicker/test/FilePicker.spec.jsx";
import _regeneratorRuntime from "@babel/runtime/regenerator";
import React from 'react';
import FilePicker from '../FilePicker';
import { filePickerUniDriverFactory } from '../FilePicker.uni.driver';
import { createRendererWithUniDriver } from '../../utils/test-utils/react';
describe('FilePicker', function () {
  describe('[async]', function () {
    runTests(createRendererWithUniDriver(filePickerUniDriverFactory));
  });
  function runTests(render) {
    var _this = this;
    var createDriver = function createDriver(jsx) {
      return render(jsx).driver;
    };
    describe('error property', function () {
      it('should not have error by default', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
        var driver;
        return _regeneratorRuntime.wrap(function _callee$(_context) {
          while (1) switch (_context.prev = _context.next) {
            case 0:
              driver = createDriver(/*#__PURE__*/React.createElement(FilePicker, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 16,
                  columnNumber: 37
                }
              }));
              _context.t0 = expect;
              _context.next = 4;
              return driver.hasError();
            case 4:
              _context.t1 = _context.sent;
              (0, _context.t0)(_context.t1).toEqual(false);
            case 6:
            case "end":
              return _context.stop();
          }
        }, _callee);
      })));
      it('should have error', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
        var driver;
        return _regeneratorRuntime.wrap(function _callee2$(_context2) {
          while (1) switch (_context2.prev = _context2.next) {
            case 0:
              driver = createDriver(/*#__PURE__*/React.createElement(FilePicker, {
                error: true,
                errorMessage: "error!!!",
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 22,
                  columnNumber: 11
                }
              }));
              _context2.t0 = expect;
              _context2.next = 4;
              return driver.hasError();
            case 4:
              _context2.t1 = _context2.sent;
              (0, _context2.t0)(_context2.t1).toEqual(true);
              _context2.t2 = expect;
              _context2.next = 9;
              return driver.errorMessage();
            case 9:
              _context2.t3 = _context2.sent;
              (0, _context2.t2)(_context2.t3).toEqual('error!!!');
            case 11:
            case "end":
              return _context2.stop();
          }
        }, _callee2);
      })));
    });
    describe('name property', function () {
      it('should not have name property by default', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
        var driver;
        return _regeneratorRuntime.wrap(function _callee3$(_context3) {
          while (1) switch (_context3.prev = _context3.next) {
            case 0:
              driver = createDriver(/*#__PURE__*/React.createElement(FilePicker, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 31,
                  columnNumber: 37
                }
              }));
              _context3.t0 = expect;
              _context3.next = 4;
              return driver.getName();
            case 4:
              _context3.t1 = _context3.sent;
              (0, _context3.t0)(_context3.t1).toEqual('');
            case 6:
            case "end":
              return _context3.stop();
          }
        }, _callee3);
      })));
      it('should have name', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
        var driver;
        return _regeneratorRuntime.wrap(function _callee4$(_context4) {
          while (1) switch (_context4.prev = _context4.next) {
            case 0:
              driver = createDriver(/*#__PURE__*/React.createElement(FilePicker, {
                name: "filePickerName",
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 36,
                  columnNumber: 37
                }
              }));
              _context4.t0 = expect;
              _context4.next = 4;
              return driver.getName();
            case 4:
              _context4.t1 = _context4.sent;
              (0, _context4.t0)(_context4.t1).toEqual('filePickerName');
            case 6:
            case "end":
              return _context4.stop();
          }
        }, _callee4);
      })));
    });
  }
});