"use strict";

require("@testing-library/jest-dom");
var _react = require("@testing-library/react");
var _Switch = require("../Switch");
var _jsxRuntime = require("react/jsx-runtime");
describe('Switch Specs', function () {
  test('should not have `selected` className', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.SwitchBase, {}));
    var unexpected = 'selected';
    var actual = _react.screen.getByRole('button');
    expect(actual).not.toHaveClass(unexpected);
  });
  test('should have `selected` if selected prop is true', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.SwitchBase, {
      selected: true
    }));
    var actual = _react.screen.getByRole('button');
    var expected = 'selected';
    expect(actual).toHaveClass(expected);
  });
  test('should have animated class by default', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.SwitchBase, {}));
    var actual = _react.screen.getByRole('button');
    var expected = 'animated';
    expect(actual).toHaveClass(expected);
  });
  test('should not have animated class when `noAnimation` prop is true', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.SwitchBase, {
      noAnimation: true
    }));
    var actual = _react.screen.getByRole('button');
    var expected = 'animated';
    expect(actual).not.toHaveClass(expected);
  });
  test('should show default icon `circle`', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.SwitchBase, {}));

    // decimal converted charCode of Unicode 'circle' character
    var expectedCode = 983071;
    var actualCode = _react.screen.getByRole('button').children[0].textContent.codePointAt();
    expect(actualCode).toBe(expectedCode);
  });
  test('should show `squarelarge` icon for Carbon skin', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_Switch.SwitchBase, {
      skin: "carbon"
    }));

    // decimal converted charCode of Unicode 'squarelarge' character
    var expectedCode = 11035;
    var actualCode = _react.screen.getByRole('button').children[0].textContent.codePointAt();
    expect(actualCode).toBe(expectedCode);
  });
});