"use strict";

require("@testing-library/jest-dom");
var _react = require("@testing-library/react");
var _CheckboxItem = require("../CheckboxItem");
var _jsxRuntime = require("react/jsx-runtime");
describe('CheckboxItem Specs', function () {
  test('should support a custom icon', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckboxItem.CheckboxItemBase, {
      icon: "star",
      children: "Hello CheckboxItem"
    }));
    var expected = 983272; // decimal converted charCode of Unicode 'star' character used by agate
    var actual = _react.screen.getAllByRole('checkbox')[1].textContent.codePointAt();
    expect(actual).toBe(expected);
  });
  test('should render correct icon when selected', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckboxItem.CheckboxItemBase, {
      selected: true
    }));
    var checkbox = _react.screen.getAllByRole('checkbox')[1];
    var expected = '✓';
    expect(checkbox).toHaveTextContent(expected);
  });
  test('should include the indeterminate class when indeterminate', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckboxItem.CheckboxItemBase, {
      indeterminate: true,
      children: "Hello CheckboxItem"
    }));
    var checkbox = _react.screen.getAllByRole('checkbox')[1];
    var expected = 'indeterminate';
    expect(checkbox).toHaveClass(expected);
  });
  test('should not include the indeterminate class when not indeterminate', function () {
    (0, _react.render)( /*#__PURE__*/(0, _jsxRuntime.jsx)(_CheckboxItem.CheckboxItemBase, {
      children: "Hello CheckboxItem"
    }));
    var checkbox = _react.screen.getAllByRole('checkbox')[1];
    var notExpected = 'indeterminate';
    expect(checkbox).not.toHaveClass(notExpected);
  });
});