"use strict";

var _jsxRuntime = require("react/jsx-runtime");

var _enzyme = require("enzyme");

var _Switch = _interopRequireWildcard(require("../Switch"));

function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }

function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

describe('Switch Specs', function () {
  test('should have `selected` if selected prop is true', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch["default"], {
      selected: true
    }));
    var expected = true;
    var actual = subject.find('Switch').prop('selected');
    expect(actual).toBe(expected);
  });
  test('should have animated class by default', function () {
    var subject = (0, _enzyme.shallow)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.SwitchBase, {}));
    var expected = true;
    var actual = subject.hasClass('animated');
    expect(actual).toBe(expected);
  });
  test('should not have animated class when noAnimation prop is true', function () {
    var subject = (0, _enzyme.shallow)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.SwitchBase, {
      noAnimation: true
    }));
    var expected = false;
    var actual = subject.hasClass('animated');
    expect(actual).toBe(expected);
  });
});