import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
var _jsxFileName = "/home/builduser/work/57e038ea7326c1ec/packages/wix-design-system/dist/esm/ToggleSwitch/test/ToggleSwitch.spec.jsx";
import _regeneratorRuntime from "@babel/runtime/regenerator";
import React from 'react';
import ToggleSwitch from '../ToggleSwitch';
import { toggleSwitchDriverFactory as toggleSwitchUniDriverFactory } from '../ToggleSwitch.uni.driver';
import { createRendererWithUniDriver, cleanup } from '../../utils/test-utils/react';
import { SKINS, SIZES } from '../ToggleSwitch.constants';
describe('ToggleSwitch', function () {
  describe('[async]', function () {
    runTests(createRendererWithUniDriver(toggleSwitchUniDriverFactory));
  });
  function runTests(render) {
    var _this = this;
    afterEach(function () {
      return cleanup();
    });
    describe('block props', function () {
      it('should not pass inline styles prop', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
        var redRgb, styles, _render, driver;
        return _regeneratorRuntime.wrap(function _callee$(_context) {
          while (1) switch (_context.prev = _context.next) {
            case 0:
              redRgb = 'rgb(255, 0, 0)';
              styles = {
                root: {
                  color: redRgb
                }
              };
              _render = render(/*#__PURE__*/React.createElement(ToggleSwitch, {
                styles: styles,
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 23,
                  columnNumber: 35
                }
              })), driver = _render.driver;
              _context.t0 = expect;
              _context.next = 6;
              return driver.getRootStyles();
            case 6:
              _context.t1 = _context.sent.color;
              (0, _context.t0)(_context.t1).not.toBe(redRgb);
            case 8:
            case "end":
              return _context.stop();
          }
        }, _callee);
      })));
    });
    describe('size prop', function () {
      it('should be "large" by default', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
        var _render2, driver;
        return _regeneratorRuntime.wrap(function _callee2$(_context2) {
          while (1) switch (_context2.prev = _context2.next) {
            case 0:
              _render2 = render(/*#__PURE__*/React.createElement(ToggleSwitch, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 30,
                  columnNumber: 35
                }
              })), driver = _render2.driver;
              _context2.t0 = expect;
              _context2.next = 4;
              return driver.getSize();
            case 4:
              _context2.t1 = _context2.sent;
              (0, _context2.t0)(_context2.t1).toBe(SIZES.large);
            case 6:
            case "end":
              return _context2.stop();
          }
        }, _callee2);
      })));
      Object.values(SIZES).forEach(function (size) {
        it("should be \"".concat(size, "\""), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
          var _render3, driver;
          return _regeneratorRuntime.wrap(function _callee3$(_context3) {
            while (1) switch (_context3.prev = _context3.next) {
              case 0:
                _render3 = render(/*#__PURE__*/React.createElement(ToggleSwitch, {
                  size: size,
                  __self: _this,
                  __source: {
                    fileName: _jsxFileName,
                    lineNumber: 36,
                    columnNumber: 37
                  }
                })), driver = _render3.driver;
                _context3.t0 = expect;
                _context3.next = 4;
                return driver.getSize();
              case 4:
                _context3.t1 = _context3.sent;
                (0, _context3.t0)(_context3.t1).toBe(size);
              case 6:
              case "end":
                return _context3.stop();
            }
          }, _callee3);
        })));
      });
    });
    describe('skin prop', function () {
      it('should be "standard" by default', /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4() {
        var _render4, driver;
        return _regeneratorRuntime.wrap(function _callee4$(_context4) {
          while (1) switch (_context4.prev = _context4.next) {
            case 0:
              _render4 = render(/*#__PURE__*/React.createElement(ToggleSwitch, {
                __self: _this,
                __source: {
                  fileName: _jsxFileName,
                  lineNumber: 44,
                  columnNumber: 35
                }
              })), driver = _render4.driver;
              _context4.t0 = expect;
              _context4.next = 4;
              return driver.getSkin();
            case 4:
              _context4.t1 = _context4.sent;
              (0, _context4.t0)(_context4.t1).toBe(SKINS.standard);
            case 6:
            case "end":
              return _context4.stop();
          }
        }, _callee4);
      })));
      Object.values(SKINS).forEach(function (skin) {
        it("should be \"".concat(skin, "\""), /*#__PURE__*/_asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5() {
          var _render5, driver;
          return _regeneratorRuntime.wrap(function _callee5$(_context5) {
            while (1) switch (_context5.prev = _context5.next) {
              case 0:
                _render5 = render(/*#__PURE__*/React.createElement(ToggleSwitch, {
                  skin: skin,
                  __self: _this,
                  __source: {
                    fileName: _jsxFileName,
                    lineNumber: 50,
                    columnNumber: 37
                  }
                })), driver = _render5.driver;
                _context5.t0 = expect;
                _context5.next = 4;
                return driver.getSkin();
              case 4:
                _context5.t1 = _context5.sent;
                (0, _context5.t0)(_context5.t1).toBe(skin);
              case 6:
              case "end":
                return _context5.stop();
            }
          }, _callee5);
        })));
      });
    });
  }
});