"use strict";

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

var _enzyme = require("enzyme");

var _CheckboxItem = require("../CheckboxItem");

var _CheckboxModule = _interopRequireDefault(require("../../Checkbox/Checkbox.module.css"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }

describe('CheckboxItem Specs', function () {
  test('should support a custom icon', function () {
    var expected = 'star';
    var subject = (0, _enzyme.shallow)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckboxItem.CheckboxItemBase, {
      icon: expected,
      children: "Hello CheckboxItem"
    }));
    var actual = subject.find('Checkbox').prop('children');
    expect(actual).toBe(expected);
  });
  test('should render correct icon when selected', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckboxItem.CheckboxItemBase, {
      selected: true
    }));
    var expected = 1;
    var actual = subject.find('Checkbox').find(".".concat(_CheckboxModule["default"].selected)).length;
    expect(actual).toBe(expected);
  });
  test('should include the indeterminate class when indeterminate', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckboxItem.CheckboxItemBase, {
      indeterminate: true,
      children: "Hello CheckboxItem"
    }));
    var expected = 1;
    var actual = subject.find('Checkbox').find(".".concat(_CheckboxModule["default"].indeterminate)).length;
    expect(actual).toBe(expected);
  });
  test('should not include the indeterminate class when not indeterminate', function () {
    var subject = (0, _enzyme.mount)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckboxItem.CheckboxItemBase, {
      children: "Hello CheckboxItem"
    }));
    var expected = _CheckboxModule["default"].indeterminate;
    var actual = subject.find('Checkbox').find(".".concat(_CheckboxModule["default"].indeterminate));
    expect(actual).not.toContain(expected);
  });
});